Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IN clause in query for integers

 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a list of integers. This list holds values for an integer column in a table. I want to create a hibernate query that will get all the records for the values in this list.

For example I have a list of emp_nos, I want to do something like this in hibernate...

select * from emp where emp_no in (15,42,22)

Here 15,42,22 and the list of ints in my collection.

So my list is a java collection of integers and I need to plug this list into the IN clause of a hibernate query.

Any suggestions on how I can do this.

Thanks in advance for any help,
Jehan

[ May 09, 2008: Message edited by: Jehan Jaleel ]

[ May 12, 2008: Message edited by: Jehan Jaleel ]
[ May 12, 2008: Message edited by: Jehan Jaleel ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic