hi folks,
list<integer> typelist = new arraylist<integer>(); typelist.add(1); typelist.add(2); expression<collection> expr = criteriabuilder.literal(typelist); path<integer> path = root.get("type"); path.in(expr);
the generated sql restriction type be:
type=(1,2)
instead of
type in (1,2)
the following works
path.in(typelist)
works. problem code? in our case, have convert collection expression.
edit:
predicate in(expression<?>... values) predicate in(expression<java.util.collection<?>> values)
it seems invokes first method (wrong). how fix it? seems jpa defines many overloaded methods ambiguous itself.
edit:
how create expression collection? literal(values) maybe not right way. jpa might think single value, , replace in equal comparator.
Comments
Post a Comment