c.add(Restrictions.in("id",(Collection) value(IDS))); Hierarchy.fetchChildren(c,(Class) value(CLASS),Integer.MAX_VALUE);
Criteria[] hy = Hierarchy.fetchParents(c,(Class) value(CLASS),Integer.MAX_VALUE); hy[hy.length-1].add(Restrictions.in("id",(Collection) value(IDS)));
    protected void buildQuery(Session session)     throws HibernateException, SQLException    {        Criteria c = session.createCriteria((Class) value(CLASS));        c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);        c.add(Restrictions.in("id",(Collection) value(IDS)));        Hierarchy.fetchChildren(c,(Class) value(CLASS),Integer.MAX_VALUE);        setCriteria( c );    }