• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate query help

 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Walter Bernstein
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use "setParameterList()": http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Query.html
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic