-->
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: Native SQL usage of the IN-operator?
PostPosted: Fri Feb 06, 2009 10:48 am 
Newbie

Joined: Thu Aug 30, 2007 10:03 am
Posts: 8
Hi,

i've been creating an query like:

"SELECT a.name a.amount FROM ans a where a.ID in "

Now, i want to put a List of ID's to the String to use the IN-Operator. Is this possible?



Thanx


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 10, 2009 2:08 am 
Expert
Expert

Joined: Fri Jan 30, 2009 1:47 am
Posts: 292
Location: Bangalore, India
Yes that is possible.
Either you can hard code the ids like IN(1,2,3)
OR you can use IN(:idList) and then set the parameter value using org.hibernate.Query.setParameterList

_________________
Regards,
Litty Preeth


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.