mysema/querydsl — Issue #72: Invalid JPQL generated on IN clauses
Author: luisfpg
Created: 2011-12-19 16:18:00+00:00
State: open

QueryDSL JPA 2.3.0 is generating invalid queries when using IN clauses.
The problem is a missing parenthesis.

Generated query:
and x.y in :a

When should be
and x.y in (:a)

The fix is trivial: JPQLTemplates has this:
add(Ops.IN, "{0} in {1}");

It should be:
add(Ops.IN, "{0} in ({1})");

As a workaround, I've created a custom templates (extending HQLTemplates) which invokes the add(Ops.IN, "{0} in ({1})"); on the constructor.