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
You could do that too.
Repository:
`MyObject findByParameterOneAndParameterTwo( String parameterOne, String parameterTwo);`
if you pass a null parameterTwo, the generated JPQL will include the IS NULL condition:
`myobject0_.parameterTwo is null`
Ex: repository.findByParameterOneAndParameterTwo("D", null);
Reference: https://www.baeldung.com/spring-data-jpa-null-parameters#query-methods