-->
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: HQL: Unexpected token for ...where ID is in (1, 2, 3)
PostPosted: Thu Oct 19, 2006 7:51 pm 
Newbie

Joined: Thu Oct 19, 2006 7:45 pm
Posts: 1
My query is:

from ResourceTable where resourceId is in ('1','3','13','14','15','16','17','18','19','20','21','7','8','9','10')

I've also tried formatting the list as
(1,2,3)
(1, 2, 3)
('1', '2', '3')
1,2,3
and
1, 2, 3

Invariably, I get

Data Access Failure

unexpected token: in near line 1, column 60 [from com.company.model.ResourceTable where resourceId is in ('1','3','13','14','15','16','17','18','19','20','21','7','8','9','10')]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: in near line 1, column 60 [from com.company.model.ResourceTable where resourceId is in ('1','3','13','14','15','16','17','18','19','20','21','7','8','9','10')]

Does anyone have any pointers on successful use of the "is in" syntax for HQL?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 10:15 pm 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
Lose the 'is'.

Code:
from ResourceTable where resourceId in ('1','3','13','14','15','16','17','18','19','20','21','7','8','9','10')


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.