-->
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: getReturnTypes() fails on collection filter
PostPosted: Fri Dec 02, 2005 5:08 am 
Newbie

Joined: Fri Dec 02, 2005 4:43 am
Posts: 1
Hi

I'm using a simple collection filter: query = session.createFilter(docs, "where this.id < 20").

The filter works fine, but as soon as I call query.getReturnTypes(), I get an exception (see bellow). I have to call it because I'm writing a query execution framework and I need reflection.

It happened on 3.0.5 and 3.1 CVS.

Is this a bug or am I doing something wrong?

The log:

[DEBUG] QueryTranslatorImpl - -HQL: where this.total < 20
[DEBUG] QueryTranslatorImpl - -SQL: select document0_.ID as ID2_, document0_.ADDRESSID as ADDRESSID2_, document0_.TOTAL as TOTAL2_ from DOCUMENT document0_ where document0_.ADDRESSID = ? and document0_.TOTAL<20
[DEBUG] ErrorCounter - -throwQueryException() : no errors
[DEBUG] QueryTranslatorImpl - -parse() - HQL: where this.total < 20
[DEBUG] AST - ---- HQL AST ---
\-[QUERY] 'query'
+-[SELECT_FROM] 'SELECT_FROM'
| \-[FROM] '{filter-implied FROM}'
\-[WHERE] 'where'
\-[LT] '<'
+-[DOT] '.'
| +-[IDENT] 'this'
| \-[IDENT] 'total'
\-[NUM_INT] '20'

[DEBUG] ErrorCounter - -throwQueryException() : no errors
[DEBUG] HqlSqlBaseWalker - -select << begin [level=1, statement=select]
[ERROR] PARSER - -<AST>:0:0: unexpected end of subtree
<AST>:0:0: unexpected end of subtree
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2933)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:686)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:542)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:279)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:227)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:105)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:74)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:53)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
at org.hibernate.impl.SessionFactoryImpl.getReturnTypes(SessionFactoryImpl.java:617)
at org.hibernate.impl.AbstractQueryImpl.getReturnTypes(AbstractQueryImpl.java:152)
at hibernate.HibernateApp.runQuery(HibernateApp.java:161)
at hibernate.HibernateApp.query(HibernateApp.java:122)
at hibernate.HibernateApp.main(HibernateApp.java:50)
[DEBUG] ErrorCounter - -<AST>:0:0: unexpected end of subtree <<AST>:0:0: unexpected end of subtree>
[ERROR] PARSER - - Invalid path: 'this.total'
Invalid path: 'this.total'
at org.hibernate.hql.ast.util.LiteralProcessor.lookupConstant(LiteralProcessor.java:93)
at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:178)
at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:94)
at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:90)
at org.hibernate.hql.ast.HqlSqlWalker.resolve(HqlSqlWalker.java:660)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1213)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4022)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3556)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1756)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:774)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:575)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:279)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:227)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:105)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:74)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:53)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
at org.hibernate.impl.SessionFactoryImpl.getReturnTypes(SessionFactoryImpl.java:617)
at org.hibernate.impl.AbstractQueryImpl.getReturnTypes(AbstractQueryImpl.java:152)
at hibernate.HibernateApp.runQuery(HibernateApp.java:161)
at hibernate.HibernateApp.query(HibernateApp.java:122)
at hibernate.HibernateApp.main(HibernateApp.java:50)

Regards,
Lucian


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.