-->
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.  [ 2 posts ] 
Author Message
 Post subject: org.hibernate.hql.ast.querysyntaxexception unexpected token
PostPosted: Thu Sep 13, 2012 8:33 am 
Newbie

Joined: Thu Sep 13, 2012 8:15 am
Posts: 1
Hi

I struggle to select values from two tables and display in simple java application.


Sep 13, 2012 5:21:52 PM org.hibernate.hql.ast.ErrorCounter reportError
SEVERE: line 1:95: unexpected token: on
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: on near line 1, column 95 [ select STUDENT.Student_name,COURSE.Column_Name from STUDENT STUDENT inner join COURSE COURSE on STUDENT.Student_id=COURSE.Column_ID]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)

Any assistance will be greatly appreciated.


thanks & Regards
krishna


Top
 Profile  
 
 Post subject: Re: org.hibernate.hql.ast.querysyntaxexception unexpected token
PostPosted: Fri Sep 14, 2012 3:02 am 
Newbie

Joined: Wed Sep 21, 2011 2:20 pm
Posts: 16
you are probably in the wrong forum here.

but it seems like you are using plain SQL in a HQL query. If you want to use plain SQL you have to use

createSQLQuery, not createQuery

see: http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/querysql.html

regards


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