I have a JPQL named query that takes a List
as a parameter. I'm using the parameter in an IN
phrase:
...WHERE x.id IN :list
I'd like to do something like the following but the syntax apparently won't let me:
...WHERE :list IS EMPTY OR x.id IN :list
Neither will:
...WHERE SIZE(:list) = 0 OR x.id IN :list
Is what I'm trying to do impossible in a JPA 2.0 named query? I know how to do it via the criteria API or using plain old JPQL strings.