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.  [ 3 posts ] 
Author Message
 Post subject: org.hibernate.hql.antlr.HqlBaseParser.unaryExpression
PostPosted: Tue Jul 14, 2009 4:32 pm 
Newbie

Joined: Tue Jul 14, 2009 4:13 pm
Posts: 3
We have recently migrated from hibernate 2.1 to 3.0 version, while migrating we faced the following issues unresolved. Thanks to hibernate since the document provides the basic migration steps.

The given query threw exception while parsed by hibernate 3.0

SELECT indv,a, p , indv1.firstName, indv1.lastName, indv2.firstName, indv2.lastName FROM com.domain.IndividualXAddress i,com.domain.Address a, com.domain.User indv, com.domain.User indv1,com.domain.User indv2 , com.domain.Payer p WHERE i.userId = indv.userId AND i.addressId = a.addressId AND indv.companyId = p.companyId AND indv.approverUserId = indv1.userId(+) AND indv.adminUserID = indv2.userId(+) AND i.isDefault = 'T' AND indv.userId = :userId AND indv.status IN ('A','I')
15:43:50:975 - ERROR - ? - line 1:457: unexpected token: )
15:43:51:007 - DEBUG - ? - line 1:457: unexpected token: )
line 1:457: unexpected token: )
org.hibernate.hql.antlr.HqlBaseParser.unaryExpression(HqlBaseParser.java:3223)
at org.hibernate.hql.antlr.HqlBaseParser.unaryExpression(HqlBaseParser.java:3173)
at org.hibernate.hql.antlr.HqlBaseParser.multiplyExpression(HqlBaseParser.java:3098)
at org.hibernate.hql.antlr.HqlBaseParser.additiveExpression(HqlBaseParser.java:2818)

It seems + operator causing this issue. It was failing though I changed to JOINs.

Is there anything wrong in the query?

Please throw some light on this as this urgent.


Top
 Profile  
 
 Post subject: Re: org.hibernate.hql.antlr.HqlBaseParser.unaryExpression
PostPosted: Wed Jul 15, 2009 3:58 pm 
Newbie

Joined: Tue Jul 14, 2009 4:13 pm
Posts: 3
I got below errors after changing from + operator to JOIN

org.hibernate.hql.ast.QuerySyntaxException: unexpected token: join near line 1, column 386 [ SELECT indv,a, p , indv1.firstName, indv1.lastName, indv2.firstName, indv2.lastName FROM com.domain.IndividualXAddress i, com.domain.Address a, com.domain.User indv, com..domain.User indv1,com.domain.User indv2 , com.domain.Payer p WHERE i.userId = indv.userId AND i.addressId = a.addressId AND join indv.companyId = p.companyId AND join indv.approverUserId = indv1.userId AND join indv.adminUserID = indv2.userId AND i.isDefault = 'T' AND indv.userId = :userId AND indv.status IN ('A','I') ]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)

Please throw some light on this.


Top
 Profile  
 
 Post subject: Re: org.hibernate.hql.antlr.HqlBaseParser.unaryExpression
PostPosted: Wed Jul 15, 2009 4:02 pm 
Newbie

Joined: Tue Jul 14, 2009 4:13 pm
Posts: 3
Igore the previous reply.

I got below errors after changing from + operator to JOIN

11:44:52:089 - ERROR - ? - unexpected token: ON near line 1, column 151 [ SELECT indv, a, p, indv1.firstName, indv1.lastName, indv2.firstName, indv2.lastName FROM com.domain.IndividualXAddress i JOIN User indv ON (i.userId = indv.userId) JOIN Address a ON (i.addressId = a.addressId) JOIN Payer p ON (indv.companyId = p.companyId) LEFT OUTER JOIN User indv2 ON (indv.approverUserId=indv2.userId) LEFT OUTER JOIN User indv3 ON (indv.adminUserId = indv3.userId) WHERE userId = ?]
Please throw some light on this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.