c.add(Restrictions.in("details.id",(Collection) value("annotatorIds")));
Collection annotatorIds = (Collection) value("annotatorIds"); if (annotatorIds != null && annotatorIds.size() > 0) c.add(Restrictions.in("details.id", annotatorIds ));
    protected Object runQuery(Session session)         throws HibernateException, SQLException    {        PojoOptions po = new PojoOptions((Map) value(QP.OPTIONS));                Class target = typeToAnnotationType.get((Class) value(QP.CLASS));        String path = annotationTypeToPath.get(target);                Criteria c = session.createCriteria(target);                c.createCriteria(path,LEFT_JOIN);        c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);        c.add(Restrictions.in(path+".id",(Collection) value(QP.IDS)));                if (check("annotatorIds"))        {            c.add(Restrictions.in("details.id",(Collection) value("annotatorIds")));        }        return c.list();    }