title: HQL diff 2 date in days
body: <p>I write right SQL query:</p>
  
  <pre><code>SELECT i, (i.sme_end - '2015-09-10') 
  FROM Incidents i 
  WHERE (i.sme_end - '2015-09-10') &lt;= 100 
  ORDER BY ('2015-09-10' - i.sme_end)
  </code></pre>
  
  <p>But when I rewrite this query on HQL:</p>
  
  <pre><code>java.util.Date currentDate = new java.util.Date(System.currentTimeMillis());
  int days = 100;
  session.createQuery("SELECT i, (i.smeEnd - :currentDate) "+
                  "FROM IncidentsEntity i " +
                  "WHERE (i.smeEnd - :currentDate) &lt;= :days " +
                  "ORDER BY (i.smeEnd - :currentDate)")
                  .setParameter("days", days)
                  .setParameter("currentDate", currentDate);
  </code></pre>
  
  <p>I get ClassCastException: java.lang.Integer cannot be cast to java.util.Date</p>
  
  <p>Where do I do mistake?
  Database Postgresql 9.4</p>