title: In Hibernate, how do I create a Criteria-restriction object with a function operation trunc on a column name?
body: <pre class="lang-sql prettyprint-override"><code>select * from tableA where trunc(order_date) &gt; sysdate -7;
  </code></pre>
  
  <p>Something like</p>
  
  <pre><code>Criteria criteria = getSession().createCriteria(TableA.class).
  add(Restrictions.gt("orderDate", afterSubtracting7DaysFromToday));
  </code></pre>