HQL queries with where clauses of the form: from Object where (Object.id1,Object.id2) in ((1,2), (3,4))
throw a org.hibernate.hql.ast.QuerySyntaxException, whereas a similar SQL query entered using psql executes without error.
Does anyone know how to generate such a query using HQL?
Thanks in advance, Brian
Hibernate version:
3.1.2
Mapping documents:
probably not relevant but can be supplied
Code between sessionFactory.openSession() and session.close():
too much to include
Full stack trace of any exception that occurs:
org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: {vector} [select new com.timestock.tess.data.objects.StatsAggregationData(b.id,b.user,b.transet,b.tranunit,b.userGroup,b.transetGroup,b.tranSetIncarnationId,b.userIncarnationId,b.intervalStartTime,b.intervalWireTime,b.totalTransactions,b.badTransactions,b.opportunities,b.defects,b.dataType,b.tthType,b.tthLowerSpec,b.tthUpperSpec,b.tthB0,b.tthB1,b.tthB2,b.tthB3,b.tthB4,b.tthB5,b.tthB6,b.tthB7,b.tthB8,b.tthB9,b.tthB10,b.tthB11,b.tthB12,b.tthB13,b.tthB14,b.tthB15,b.tthB16,b.tthB17,b.tthB18,b.tthB19,b.tthB20,b.tthB21,b.tthB22,b.tthB23,b.tthC0,b.tthC1,b.tthC2,b.tthC3,b.tthC4,b.tthC5,b.tthC6,b.tthC7,b.tthC8,b.tthC9,b.tthC10,b.tthC11,b.tthC12,b.tthC13,b.tthC14,b.tthC15,b.tthC16,b.tthC17,b.tthC18,b.tthC19,b.tthC20,b.tthC21,b.tthC22,b.tthC23,b.tthMax,b.tthTotalCount,b.tthSumOfSquares,b.tthSumOfValues,b.tphType,b.tphLowerSpec,b.tphUpperSpec,b.tphB0,b.tphB1,b.tphB2,b.tphB3,b.tphB4,b.tphB5,b.tphB6,b.tphB7,b.tphB8,b.tphB9,b.tphB10,b.tphB11,b.tphB12,b.tphB13,b.tphB14,b.tphB15,b.tphB16,b.tphB17,b.tphB18,b.tphB19,b.tphB20,b.tphB21,b.tphB22,b.tphB23,b.tphC0,b.tphC1,b.tphC2,b.tphC3,b.tphC4,b.tphC5,b.tphC6,b.tphC7,b.tphC8,b.tphC9,b.tphC10,b.tphC11,b.tphC12,b.tphC13,b.tphC14,b.tphC15,b.tphC16,b.tphC17,b.tphC18,b.tphC19,b.tphC20,b.tphC21,b.tphC22,b.tphC23,b.tphMax,b.tphTotalCount,b.tphSumOfSquares,b.tphSumOfValues,b.tshType,b.tshLowerSpec,b.tshUpperSpec,b.tshB0,b.tshB1,b.tshB2,b.tshB3,b.tshB4,b.tshB5,b.tshB6,b.tshB7,b.tshB8,b.tshB9,b.tshB10,b.tshB11,b.tshB12,b.tshB13,b.tshB14,b.tshB15,b.tshB16,b.tshB17,b.tshB18,b.tshB19,b.tshB20,b.tshB21,b.tshB22,b.tshB23,b.tshC0,b.tshC1,b.tshC2,b.tshC3,b.tshC4,b.tshC5,b.tshC6,b.tshC7,b.tshC8,b.tshC9,b.tshC10,b.tshC11,b.tshC12,b.tshC13,b.tshC14,b.tshC15,b.tshC16,b.tshC17,b.tshC18,b.tshC19,b.tshC20,b.tshC21,b.tshC22,b.tshC23,b.tshMax,b.tshTotalCount,b.tshSumOfSquares,b.tshSumOfValues,b.statsVersion) from com.timestock.tess.data.objects.StatsTranSetUserGroupInterval b where b.intervalStartTime >= :startTime and b.intervalStartTime < :endTime and (b.transet,b.userGroup) in ((0,0),(600000000000000030,600000000000000137))
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
at org.hibernate.hql.ast.QueryTranslatorImpl.generate(QueryTranslatorImpl.java:209)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:178)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:134)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:113)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1602)
at com.timestock.tess.util.StatisticsAggregation.getDatabaseRows(StatisticsAggregation.java:410)
at com.timestock.tess.util.StatisticsAggregation.getDatabaseRows(StatisticsAggregation.java:334)
at com.timestock.tess.util.StatisticsAggregation.getAggregatedRows(StatisticsAggregation.java:222)
at com.timestock.tess.util.TranSetAggregation.AggregateGroup(TranSetAggregation.java:259)
at com.timestock.tess.util.TranSetAggregation.AggregateGroupHourly(TranSetAggregation.java:69)
at com.timestock.tess.services.processors.StatsProcessor.doIntervalAggregation(StatsProcessor.java:732)
at com.timestock.tess.services.processors.StatsProcessor.doIntervalAggregations(StatsProcessor.java:705)
at com.timestock.tess.services.processors.StatsProcessor.processStats(StatsProcessor.java:418)
at com.timestock.tess.services.collectors.StatsCollector$StatisticsCollector.run(StatsCollector.java:559)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: <AST>:0:0: unexpected AST node: {vector}
at org.hibernate.hql.antlr.SqlGeneratorBase.inList(SqlGeneratorBase.java:3016)
at org.hibernate.hql.antlr.SqlGeneratorBase.exoticComparisonExpression(SqlGeneratorBase.java:2831)
at org.hibernate.hql.antlr.SqlGeneratorBase.comparisonExpr(SqlGeneratorBase.java:1203)
at org.hibernate.hql.antlr.SqlGeneratorBase.booleanExpr(SqlGeneratorBase.java:851)
at org.hibernate.hql.antlr.SqlGeneratorBase.booleanOp(SqlGeneratorBase.java:2541)
at org.hibernate.hql.antlr.SqlGeneratorBase.booleanExpr(SqlGeneratorBase.java:831)
at org.hibernate.hql.antlr.SqlGeneratorBase.whereExpr(SqlGeneratorBase.java:724)
at org.hibernate.hql.antlr.SqlGeneratorBase.selectStatement(SqlGeneratorBase.java:184)
at org.hibernate.hql.antlr.SqlGeneratorBase.statement(SqlGeneratorBase.java:117)
at org.hibernate.hql.ast.QueryTranslatorImpl.generate(QueryTranslatorImpl.java:203)
... 19 more
Name and version of the database you are using:
postgres 8.1.2
The generated SQL (show_sql=true):
none due to exception
Debug level Hibernate log excerpt:
|