title: how to find difference between two timestamp using hibernate query language
body: <p>I am trying to write an hql query which gives me the number of hours between two timestamp. </p>
  
  <p>So, far i am unable to do this. I have used hql hour function but that does not work if the </p>
  
  <p>timestamp corresponds to different date. Please provide any input.</p>
  
  <p>My hql query is </p>
  
  <pre><code>select count(*) from com.xxx.Request as request where   request.id = :id and hour(current_timestamp - request.lastEventDate) &gt; :delay
  </code></pre>