79720592

Date: 2025-07-30 22:17:52
Score: 1
Natty:
Report link

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 .

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Francesco
  • User mentioned (0): @Francesco
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: oceano1970526