• Post Reply Bookmark Topic Watch Topic
  • New Topic

Query In Clause  RSS feed

 
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: 662
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!