persistence@glassfish.java.net

Cannot use entities in IN (WHERE) clause?

From: Krzysztof Adamczyk <k.adamczyk_at_merge.com.pl>
Date: Mon, 8 Oct 2007 11:05:57 +0200

Hi all,

Is this a bug that I cannot use such a syntax:
"... and e.contractor IN (contr1, contr2, contr3...)..."
in EJBQL, or I need some workaround?

The generated SQL for DB2 is missing the column name and looks like this:
"... AND IN(...)..."

contr1..3 are entities and I assign them to the query with Query.setParameter(String, Object).

If I do the same with Strings, it works, for example
" and e.shortName IN ('aa', 'bb', 'cc)... "

Any help appreciated.
Greetings,
Chris