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
Here is the way for do so:
@Query("SELECT c FROM Customer c WHERE (:name is null or c.name = :name) and (:email is null" + " or c.email = :email)") List findCustomerByNameAndEmail(@Param("name") String name, @Param("email") String email);