HQL Query Not Running

Posted by Sarang on Stack Overflow See other posts from Stack Overflow or by Sarang
Published on 2010-06-12T12:22:07Z Indexed on 2010/06/12 12:33 UTC
Read the original article Hit count: 647

Filed under:
|
select new UpdateCountDataBean(count(elements(am.actionId)) as noOfUpdates, am.pname as name) from ActivityMaster am group by am.pname

The UpdateCountDataBean is created by me while the second class i.e. ActivityMaster is POJO class.

java.lang.NullPointerException
    at org.hibernate.hql.ast.tree.MethodNode.handleElements(MethodNode.java:158)
    at org.hibernate.hql.ast.tree.MethodNode.resolveCollectionProperty(MethodNode.java:109)
    at org.hibernate.hql.ast.tree.CollectionFunction.resolve(CollectionFunction.java:22)
    at org.hibernate.hql.ast.HqlSqlWalker.processFunction(HqlSqlWalker.java:835)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.collectionFunction(HqlSqlBaseWalker.java:2558)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.aggregateExpr(HqlSqlBaseWalker.java:2907)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.count(HqlSqlBaseWalker.java:2483)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExpr(HqlSqlBaseWalker.java:1971)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.aliasedSelectExpr(HqlSqlBaseWalker.java:2057)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.constructor(HqlSqlBaseWalker.java:2226)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExpr(HqlSqlBaseWalker.java:1952)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExprList(HqlSqlBaseWalker.java:1825)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectClause(HqlSqlBaseWalker.java:1394)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:553)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
    at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
    at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
    at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
    at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
    at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
    at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
    at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
    at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
    at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about hql