This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes org.hibernate.hql.ast.QuerySyntaxError: unexpected token: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply locked New topic

org.hibernate.hql.ast.QuerySyntaxError: unexpected token:

raj chopra
Ranch Hand

Joined: Apr 09, 2012
Posts: 60
Hi All,

executing the below hql query in my web applications results in a error.

query :

String q= "select ORGNAME,VAL from ( select(count(o.organizationId) * 100/ "+
"(select count(b.comp_id.bidId) from SBBid b where b.client.clientId = " +clientId+ " "+
"and b.deletionMark <>1 and b.bid_status_code = 50 )) "+
"as VAL ,org,o.organizationName as ORGNAME "+
" from SBOrganization o , SBMember m,SBBid b ,SBClient c "+
" where "+
"o.deletionMark =0 "+
"and m.deletionMark = 0 "+
"and b.bidStatus.code =50 "+
"and b.member.memberId =m.memberId "+
"and b.client.clientId = "+clientId+
"and c.clientId=b.client.clientId "+
"and c.deletionMark<>1 "+
"and m.organizationId =o.organizationId "+
"group by o.organizationId,o.organizationName "+
"order by 1 desc "+
") "+
"where rownum <=10 ";
error in tomcat CMD prompt:

i tried my best to resolve but had no luck.

kindly help me to shoot this issue.

raj chopra
T Mishra
Ranch Hand

Joined: Apr 04, 2006
Posts: 108

Duplicate post - error at query

Tushar (SCJP 1.5)
I agree. Here's the link:
subject: org.hibernate.hql.ast.QuerySyntaxError: unexpected token:
Similar Threads
Using JSTL Data Displayed In Browser Is Getting Fixed To 24576 Bytes(24 KB)
error in query
SQL to Hibernate HQL conversion error
Want to convert my code in method