Criteria criteria = session.createCriteria(obj.getClass()).add(expression) .setProjection(Projections.property(ID_PROPERTY_NAME));
Criteria criteria = session.createCriteria(klass).add(expression).setProjection( Projections.property(ID_PROPERTY_NAME));
            public Object doInHibernate(Session session) {                Criteria criteria = session.createCriteria(obj.getClass()).add(expression)                        .setProjection(Projections.property(ID_PROPERTY_NAME));                return criteria.list();            }