-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: ASTQueryTranslatorFactory and SQL "having"
PostPosted: Tue Jan 23, 2007 9:55 am 
Newbie

Joined: Tue Jan 23, 2007 9:23 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.