title: Complicated expressions with Hibernate Criteria (like "isnull(retryCount,0)<3" )
body: <p>I have some query like</p>
  
  <pre><code>SELECT * FROM JobTable 
  WHERE isnull(retryCount,0)&lt;3 
  AND updatedOn &lt; dateadd(MI,-5,getdate())
  </code></pre>
  
  <p>How to convert it to Criteria api calls? Point to use Criteria is to allow refactoring if fields names will be changed.</p>
  
  <p>For simple things this is looks like</p>
  
  <pre><code>criteria.add(Restrictions.lt(JobTable.RETRYCOUNT_FULL, 3));
  </code></pre>
  
  <p>But what about my case? </p>
  
  <pre><code>criteria.add(Restrictions.lt(JobTable.UPDATEON_FULL, &lt;???&gt;);
  criteria.add(Restrictions.lt( &lt;someexpression(JobTable.RETRYCOUNT_FULL)&gt; , 3));
  </code></pre>