A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
video training course this week in the
Object Relational Mapping
Hibernate query help
Joined: Aug 20, 2003
Dec 19, 2007 09:41:00
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?
String hql = "select user.userID.userId from PdUser2Element user where user.elementID.elementId in :elementIds" query.createQuery(hql) query.setParameter("elementIds", "I pass a colleaction")
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
Joined: Dec 19, 2007
Dec 19, 2007 12:34:00
I agree. Here's the link:
subject: Hibernate query help
list in HQL
Hibernate Query Language where clause
Convert SQL to HQL
Stored Procedure inside HQL query?
How to use IN clause in HQL?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015