aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
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
Author

How to use IN Clause in HQL

Murali Charan
Greenhorn

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.,

SELECT * FROM FEATURE WHERE FEATURE_NAME IN ('TAX','GEO_CODE');

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?

Thanks,
Balaji
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513



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
Greenhorn

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: http://aspose.com/file-tools
 
subject: How to use IN Clause in HQL