title: Spring JPA method to find entities with beforeAndEqual a date AND afterAndEqual a date
body: <p>I have an entity Tournament as follows:</p>
  
  <pre><code>class Tournament {
      //other attributes
      private LocalDate startDate;
      private LocalDate endDate;
  }
  </code></pre>
  
  <p>This represents a tournament that runs for few days/months, from startDate to enddate. 
  I need to retrieve all Tournaments that run today, at this moment, somthing like <strong>startDate &lt;= today &amp;&amp; endDate >= today</strong>, using Spring JPA and paging. </p>
  
  <p>The closest I found was following:</p>
  
  <pre><code>@Repository
  public interface TournamentRepository extends PagingAndSortingRepository&lt;Tournament, Long&gt; {
  
      Page&lt;Tournament&gt; findByStartBeforeAndEndAfter(LocalDate date, LocalDate dateCopy, Pageable page); //today's date is passed as date and dateCopy
  
  }
  </code></pre>
  
  <p>Method call:</p>
  
  <pre><code>tournamentRepository.findByStartBeforeAndEndAfter(LocalDate.now(), LocalDate.now(), page);
  </code></pre>
  
  <p>This can be interpreted as <strong>startDate &lt; today &amp;&amp; endDate > today</strong>, so it doesn't work if a tournament runs today and only for 1 day.</p>
  
  <p>Is there a better way to do this using Spring JPA without having to write a custom query?</p>