Solve relative tables query
List<Attachment> list = session.createSQLQuery("select a.* from
Attachment a,Narelation n " +
					"where a.id = n.aid  and n.nid =
:nodeID").addEntity(Attachment.class)
			       .setParameter("nodeID", nodeID).list();