I want to have a spring data repository interface that takes two parameters. Is there a way to make it have the following behaviour?
MyObject findByParameter
Try this one,
@Query(value = "SELECT pr FROM ABCTable pr " +
"WHERE((pr.parameterOne = :parameterOne) or (pr.parameterOne = null and :parameterOne = null)) and
((pr.parameterTwo = :parameterTwo) or (pr.parameterTwo = null and :parameterTwo = null)) ")
List getSomething (@Param("parameterOne") String parameterOne,
@Param("parameterTwo") String parameterTwo);