JPA Spring repository filtering multiple parameters
<p>I am using a Spring repository as follows in order to filter by date range</p>

<pre><code>public interface CustomerRepo extends CrudRepository&lt;Customer, Long&gt; {

    public List&lt;Customer&gt; findByCreatedBetween(LocalDate start, LocalDate end);
}
</code></pre>

<p>it is ridiculous simple and is working fine, but now I need to expand my rest service to keep into account other filter criterias, for example sorted o not sorted, o filter by city and by country. When invoking the service, some parameters may be set and others not. Of course I cannot create a method like findByCreatedBetween to keep into account all possible data combinations. What is the best way to handle this scenario ?</p>

<p>Thanks !</p>