Hi All,
I 'm doing hibernate projection and my code is as follows,
DetachedCriteria detachedCriteria= DetachedCriteria.forClass(MetricsForUser.class);
detachedCriteria.setProjection(Projections.sum(attribute.getName()));
but i'm getting the following exception:
java.lang.NullPointerException
at org.hibernate.loader.criteria.CriteriaQueryTranslator.getWhereCondition(CriteriaQueryTranslator.java:334)
at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:79)
at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:59)
at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:69)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1554)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
Any help pls!!!
Rachel
|