This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate query help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate query help" Watch "Hibernate query help" New topic
Author

Hibernate query help

Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
I have this query:

select user.userID.userId from User2Element user where user.elementID.elementId in (1, 4, 19, 25, 36)

I am searching by a list of elements IDs
How can I convert this query to dynamic query by passing a list of elements IDs?


I got this error : "unexpected token"



Any help is appreciated,


SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Walter Bernstein
Ranch Hand

Joined: Dec 19, 2007
Posts: 57
Use "setParameterList()": http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Query.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate query help
 
Similar Threads
How to use IN clause in HQL?
Stored Procedure inside HQL query?
Hibernate Query Language where clause
list in HQL
Convert SQL to HQL