in
produces malformed query when called with an empty collection
#702
Labels
bug
Something isn't working
in
produces malformed query when called with an empty collection
#702
Example code:
When
ids
is a non-empty collection, the query is rendered correctly:However, when
ids
is an empty collection, the produced query is malformed (emptyWHERE
clause):This is probably a result of how
JpqlIn
is serialized - whencompareValues
is empty, the serializer just returns without doing anything, resulting in a malformed query.For reference, Hibernate deals with similar situations by replacing the
IN
predicate with1=0
. For example,turns into
when
ids
is an empty collection.This bug has already been reported here, but I was requested to create a new issue.
The text was updated successfully, but these errors were encountered: