RajaShanmugam
RajaShanmugam

Reputation: 185

How to use list of value in where clause

I am using hibernate3 in my java application. I have to find the list of value from oracle using hibernate. So my query is like

Ex:

List<TestClass> selectedpins =DAO.findAll(from register where pin in (list))

This list contains list of ids(around 3000 values). Due to performance issue i am not able to use iterator. So kindly let me know how to use this list of value in this query.

Is it possible in hibernate3?

Upvotes: 1

Views: 3231

Answers (1)

Satadru Biswas
Satadru Biswas

Reputation: 1595

session
  .createQuery("select pins from register where pin in (:list)")
  .setParameterList("list", pinIds)
  .getResultList();

Upvotes: 1

Related Questions