-->
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.  [ 5 posts ] 
Author Message
 Post subject: Unexpected AST node error - Migrate from 2.1 to 3.05
PostPosted: Wed Oct 19, 2005 2:31 pm 
Newbie

Joined: Thu May 26, 2005 6:31 pm
Posts: 19
Hibernate version: 3.05

HQL: select techProfile from TechProfile techProfile left outer join techProfile.deal.ses ses where ses.id = :seId and techProfile.status != 'closed' order by techProfile.deal.name and techProfile.targetCompletionDate

Full stack trace of any exception that occurs: Caused by: <AST>:0:0: unexpected AST node: and at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:958) at org.hibernate.hql.antlr.HqlSqlBaseWalker.orderExprs(HqlSqlBaseWalker.java:1190) at org.hibernate.hql.antlr.HqlSqlBaseWalker.orderClause(HqlSqlBaseWalker.java:1166) at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:449) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:201) at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:151) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:189) ... 26 more

The same code (HQL) is working under hibernate2. Is there any update with HQL interpreter in Hibernate3?

Did some search. Someone had the similar proble and he claimed that the new HQL does not support nexted bean property, which I don't think is the case. Please help.


Top
 Profile  
 
 Post subject: Re: Unexpected AST node error - Migrate from 2.1 to 3.05
PostPosted: Wed Oct 19, 2005 2:48 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
dshen wrote:
Hibernate version: 3.05

...
....
The same code (HQL) is working under hibernate2. Is there any update with HQL interpreter in Hibernate3?

Did some search. Someone had the similar proble and he claimed that the new HQL does not support nexted bean property, which I don't think is the case. Please help.


You should read, very carefully, the H3 Migration Guide. http://www.hibernate.org/250.html

There is a completely new HQL Query Translator in H3. You can use the old one by adding
Code:
<property name="query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>

to your hibernate.cfg.xml but that should only be done as a last resort since there are some new features that you won't be able to use with it.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 2:54 pm 
Newbie

Joined: Thu May 26, 2005 6:31 pm
Posts: 19
Thanks. Like you said

Quote:
that should only be done as a last resort since there are some new features that you won't be able to use with it.


All my unit test passed, besides two - this one and a null pointer exception one. Do not want to go to that rout yet.


Top
 Profile  
 
 Post subject: Re: Unexpected AST node error - Migrate from 2.1 to 3.05
PostPosted: Wed Oct 19, 2005 2:58 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
dshen wrote:
Hibernate version: 3.05

HQL: select techProfile from TechProfile techProfile left outer join techProfile.deal.ses ses where ses.id = :seId and techProfile.status != 'closed' order by techProfile.deal.name and techProfile.targetCompletionDate


Looking more closely at your query and the error message, try changing the ORDER BY statement to

Code:
order by techProfile.deal.name, techProfile.targetCompletionDate

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 3:40 pm 
Newbie

Joined: Thu May 26, 2005 6:31 pm
Posts: 19
It got fixed. Thanks!


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

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.