I've discovered that the JPA spec doesn't allow one to bind a List to an query like "select foo from Foo foo where status in (:statusList)". What is the preferred workaround?
Do I need to change my query to something like "select foo from Foo foo where status in (:status1, :status2, :status3, ..., :statusN), and bind each element individually?
EclipseLink's Expression criteria API allows the use of lists as arguments. So you should be able to define this query using the native Expression or DatabaseQuery API.
Otherwise you will need to dynamically generate your JPQL as you listed.
Also see bug,
James : http://www.eclipselink.org
Thanks. I have have literally hundreds of queries already written using Hibernate's query language, which I am trying to migrate over to TopLink JPA, so it seems like expanding the list in the JPQL will be less pain.