Hello Scott,
TopLink fully supports provinding a list to a IN function. There may be an issue translating the JPA query parameters to the TopLink parameters. Please file an enhancement request. If you would like you can access the TopLink query directly from the EJBQuery and set the IN parameter list on the TopLink query. If you would like more specifics I would be happy to provide them.
--Gordon
-----Original Message-----
From: Scott.Oaks_at_Sun.COM [mailto:Scott.Oaks_at_Sun.COM]On Behalf Of Scott
Oaks
Sent: Friday, April 13, 2007 1:33 PM
To: persistence_at_glassfish.dev.java.net
Subject: Syntax for "IN" parameter
I'm trying to use a named query:
@NamedQuery(name="findByCountry", query="SELECT c FROM Country c WHERE
c.id IN(:listId)")
I want to set the parameter to
'UK', 'US', 'France'
But nothing I try works. If I do
q.setParameter("listId", "US")
then I get back the results with only the US (so I know the rest of the
code is okay). But q.setParameter("listID", "'UK', 'US', 'France'")
fails to retrieve anything, as does q.setParameter("listID", "UK, US,
France") and q.setParameter("\"UK\", \"US\", \"France\").
-Scott