Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version : 3.2.1
Mapping documents:NO
Test Code
String HQL = "select coupon.id "
+ " from Participation as prtc "
+ " join prtc.parentGame as game "
+ " join game.parentCoupon as coupon "
+ " join game.templateGame as templateGame "
+ " join templateGame.gameState as gameState "
+ " where coupon.couponStatus = :cpnStatus "
+ " and gameState.mainGameCode in (:mainGameCodes) "
+ " and (game.firstDraw + prtc.drawOffset) <= :closedDraw "
+ " group by coupon.id "
+ " having sum(decode(prtc.participationStatus,:prtcStatus,1,0)) = count(*) "
+ " order by coupon.id " ; Query query = session.createQuery(HQL)
.setShort("cpnStatus",CouponStatus.PLAYED.getStatus())
.setParameterList("mainGameCodes", mainGameCodes)
.setInteger("closedDraw",endDraw.intValue())
.setShort("prtcStatus",ParticipationStatus.NOT_WINNING.getStatus());
ls = query.list();:
Error StackTrace
java.lang.NullPointerException
at org.hibernate.dialect.Dialect$3.getReturnType(Dialect.java:101)
at org.hibernate.hql.ast.util.SessionFactoryHelper.findFunctionReturnType(SessionFactoryHelper.java:382)
at org.hibernate.hql.ast.tree.AggregateNode.getDataType(AggregateNode.java:21)
at org.hibernate.hql.ast.tree.BinaryLogicOperatorNode.extractDataType(BinaryLogicOperatorNode.java:168)
at org.hibernate.hql.ast.tree.BinaryLogicOperatorNode.initialize(BinaryLogicOperatorNode.java:34)
at org.hibernate.hql.ast.HqlSqlWalker.prepareLogicOperator(HqlSqlWalker.java:1006)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3992)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1762)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.groupClause(HqlSqlBaseWalker.java:1470)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:600)
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)
at com.intralot.tests.HibernateTest.main(HibernateTest.java:179)
Database:Oracle 10g
Generated SQL:No
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html