title: Find Hibernate entities where date is between start and end dates that can be null
body: <p>I'd like to find all Event entities that that are active at a certain date. For instance:</p>
  
  <pre><code>from Event where startDate &lt;= :specifiedDate and endDate &gt; :specifiedDate
  </code></pre>
  
  <p>However, <code>Event.startDate</code> and <code>Event.endDate</code> can be <code>null</code>. A <code>null</code> value indicates that there is no start or end date (the start is infinitely in the past, or the end is infinitely in the future).</p>
  
  <p>So, <code>if Event.startDate = null and Event.endDate = 2011-05-01</code>, then that Event should be returned for all specifiedDate values less than 2011-05-01.</p>
  
  <p>Also <code>if Event.startDate = 2011-03-01 and Event.endDate = null</code>, then that Event should be returned for all specifiedDate values greater than or equal to 2011-03-01.</p>
  
  <p>Lastly, <code>if Event.startDate = null and Event.endDate = null</code>, then the Event should be returned for any specifiedDate.</p>
  
  <p>Is this possible using Hibernate and a MySQL backend?</p>