File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes How to use IN Clause in HQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to use IN Clause in HQL" Watch "How to use IN Clause in HQL" New topic

How to use IN Clause in HQL

Murali Charan

Joined: May 04, 2007
Posts: 11
Hi All,

I am new to hibernate. My project already has hibernate implementation. I have introduce a new query which should use a IN clause.

For E.g.,


I will be getting the values in the IN clause in a collection in my code.
How should i pass the value to the HQL query?
How will the HQL query look like?

Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 661

Here subTotalVariable is an Object.

lest you can use something like this,

If you are not laughing at yourself, then you just didn't get the joke.
Ram Subramanian

Joined: Feb 02, 2008
Posts: 5
It works great. Good work dude.

Tiger is Awake - SCJP, SCWCD, SCDJWS, AHM250
I agree. Here's the link:
subject: How to use IN Clause in HQL
It's not a secret anymore!