I'm using Spring Data JPA
in my project. So in repository, I define a list by following:
List<Branch> findByNameContainingAndByTypeContaining(String name, String type)
It works in this case, however, in the search form, I got more than 10 search criteria, it means and in search method, it requires more than 10 elements, and properly, field of them has value.
For example:
name: abc
type: primary
enabled: true
createdBy: null
modifiedBy: null
and so more
for findBy
method if I send blank, it works but null value. Moreover, so many fields to search. So I'm looking for a better way to search a form like this. In Grails framework, I can create nameQueries for this but not find a better way in Spring JPA
.
Any ideas? Thanks.