title: How to implement long/complex query with spring-data-jpa 2.1
body: <p>I need some advice with implementing spring JPA query. My query is complex, because of the input length.<br>
  As input I've:  </p>
  
  <ul>
  <li>15 condition - check equality if not null;</li>
  <li>2 condition - check between if not null  </li>
  <li>Additionally, the output must be pageable.</li>
  </ul>
  
  <p>I know that this can be solved by using standard PagingAndSortingRepository like:</p>
  
  <pre><code>Page&lt;A&gt; findAllByParam1AndParam2AndParam3Between...(@Nullable String param1, @Nullable String param2, @Nullable Integer param3,...) 
  </code></pre>
  
  <p>but looking on how long my input is this solution looks unclear and I don't think that method with so many parameters is a good solution.
  I was also thinking about <code>findAll</code> by Example, but this is supporting equality, not the between condition.</p>
  
  <p><strong><em>Any other options?</em></strong><br>
  The only way to go is by building a custom query with <strong>CriteriaBuilder</strong>?</p>