-->
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.  [ 7 posts ] 
Author Message
 Post subject: Query Doesnt get executed
PostPosted: Fri Jun 06, 2008 1:27 pm 
Newbie

Joined: Thu Jun 05, 2008 12:53 pm
Posts: 5
Hi,

I am trying to execute a simple query

select a from order_item a where a.status=2

I get the following exception:
net.sf.hibernate.QueryException: in expected: a [select a from order_item a where a.status=2 ]
at net.sf.hibernate.hql.FromParser.token(FromParser.java:102)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:142)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:295)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1572)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1543)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:49)
at

How can I resolve the same
Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 06, 2008 3:25 pm 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
http://www.laliluna.de/222.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 06, 2008 3:30 pm 
Newbie

Joined: Thu Jun 05, 2008 12:53 pm
Posts: 5
I checked that earlier, but in my case there was no spelling mistake. I checked the table name and there is no difference in the spelling.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 07, 2008 7:32 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
What is the data type of status?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 08, 2008 12:29 pm 
Newbie

Joined: Thu Jun 05, 2008 12:53 pm
Posts: 5
The data type is Integer.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 09, 2008 1:59 am 
Newbie

Joined: Tue Apr 29, 2008 1:42 pm
Posts: 12
Did it work when directly querying the database?

-Sweta


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 09, 2008 9:18 am 
Newbie

Joined: Thu Jun 05, 2008 12:53 pm
Posts: 5
Yes it works when I query the database directly.

--Joe


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