title: ORA-00932: inconsistent datatypes: expected DATE got BINARY in Hibernate
body: <p>My query is like this:</p>
  
  <pre><code>where (:startDate is null or :endDate is null or DDATE between :startDate AND :endDate)
  AND (:startDate is null or (:endDate is not null or DDATE between :startDate AND :date))
  </code></pre>
  
  <p>I get <code>startDate</code> and <code>endDate</code> from ajax date picker. <code>date</code> is the system date, which I am getting like this:</p>
  
  <pre><code>Date utiDate = new Date();
  </code></pre>
  
  <p>When I execute my query, I get the error:</p>
  
  <pre class="lang-none prettyprint-override"><code>java.sql.SQLException: ORA-00932: inconsistent datatypes: expected DATE got BINARY
  </code></pre>