aspose file tools*
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 Spring in Action this week in the Spring 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