title: How to combine LEFT JOIN and Where clause with JPQL?
body: <p>I have two JPA entities : </p>
  
  <ul>
  <li>Schedule (containing a list of reservations)</li>
  <li>Reservation (containing a Date field : Date resDate)</li>
  </ul>
  
  <p>My goal is to only retrieve reservations matching a date parameter (planningDate) while retrieving all schedules no matter if the reservation exists or not at this given date.</p>
  
  <p>So I wrote :  </p>
  
  <pre><code>SELECT s FROM Schedule as s LEFT JOIN s.reservations as r WHERE r.resDate = :planningDate order by s.startHour
  </code></pre>
  
  <p>Why aren't schedules, without reservations on this date, retrieved despite my LEFT JOIN ?</p>
  
  <p>Probably, like native queries, LEFT JOIN looks like INNER JOIN when combining with a WHERE clause. </p>
  
  <p>So, how could the query be changed to fulfill my requirement ? I haven't found a specific feature in JPQL.</p>