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

Query In Clause

 
Gobind Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a collection of values that I wish to use for my IN clause of my sql query.

I have formed my query string so that it looks like:

Sselect relCustomer from RelativeCustomer as relCustomer where
relCustomer.accountBranchId = :branchId

I want to add another filter onto this to say:
WHERE relCustomer.accountId IN(#some comma seperated values here#)

How do i place the entire list of values in the IN clause? Is there a neat way of doing it in Hibernate. IS this what the Criteria class/interface is used for? please can someone give me an example.
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic