Comment 0 for bug 767500

Revision history for this message
Timo Westkämper (timo-westkamper) wrote : JPA/SQL : In query fails

SQLTemplates templates = new MySQLTemplates();
HibernateSQLQuery query = new HibernateSQLQuery(session, templates);

Collection collection = new ArrayList();
collection.add("test1");
collection.add("test");

query.from(example).where(example.column.in(collection));

it's returning

select example.*
from example example
where example.column in ?, ?

It fails due to MySQL needing parens - in (?,?)

Is this a bug or am I doing something wrong?