JPQL IN clause: Java-Arrays (or Lists, Sets...)?

Posted by Bernd Haug on Stack Overflow See other posts from Stack Overflow or by Bernd Haug
Published on 2010-05-05T10:21:55Z Indexed on 2010/05/08 10:28 UTC
Read the original article Hit count: 1003

Filed under:
|
|
|
|

I would like to load all objects that have a textual tag set to any of a small but arbitrary number of values from our database. The logical way to go about this in SQL would be to build an "IN" clause. JPQL allows for IN, but it seems to require me to specify every single parameter to IN directly (as in, "in (:in1, :in2, :in3)").

Is there some way to specify an array, or a list (or some other container) that should be unrolled to the values of an IN clause?

© Stack Overflow or respective owner

Related posts about jpql

Related posts about jpa