fetchParents(c,Project.class,2);
c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); c.add(Restrictions.in("id",(Collection) value(QP.IDS))); Hierarchy.fetchParents(c,(Class) value(QP.CLASS),Integer.MAX_VALUE);
    protected Object runQuery(Session session) throws HibernateException, SQLException    {        Criteria c = session.createCriteria(Image.class);        fetchParents(c,Project.class,2);        return c.list();            }