title: How to combine multiple date-between searches with CrudRepository of Spring Data JPA?
body: <p>spring-data provides a way to generate SQL search by defining the method name.</p>
  
  <p>The following works fine:</p>
  
  <pre><code>@Entity
  public class Book {
    Date from, to;
  }
  
  //CrudRepository&lt;Book&gt;
  findByFromDateBetween(Date departure, Date arrival);
  </code></pre>
  
  <p>But why then does the following not work?</p>
  
  <pre><code>findByFromDateBetweenAndToDateBetween(Date departure, Date arrival);
  </code></pre>
  
  <p>To connect two date searches, I have to repeat the date:</p>
  
  <pre><code>findByFromDateBetweenAndToDateBetween(Date departure, Date arrival, Date departure, Date arrival);
  </code></pre>
  
  <p>Question: is it possible to reuse the params?</p>