Like @M. Deinum and @Francesco Poli mentioned in the comment.
A field in a like query cannot be null. one is null here that is not possible with a like hence the error when binding the parameters with the automatically generated query.
To remove the IllegalArgumentException
, the like
can be removed and made like
Iterable<SomeModel> findByOneAndTwoIgnoreCaseOrderByOneAsc(@Nullable Integer one, @Nullable String two);
but this leads to unable to search on not the exact property values like part of a string. To handle this, @Francesco Poli answer of using Query by Example helps using the Example
and the ExampleMatcher
.