title: grails or hibernate criteria to search only by time component
body: <p>Given below is my Domain object.</p>
  
  <pre><code>Game {
      Date startDate
  }
  </code></pre>
  
  <p>Now I want to only search the games which start at hh:mm AM (dynamic search) in the morning regardless of date. I am looking for Grails criteria something like this</p>
  
  <pre><code>Game.where {
      startDate.timePart == timeValue
  }.list()
  </code></pre>
  
  <p>Where timeValue  = "10:30 AM" or anything like that.</p>
  
  <p>I am using Hibernate criteria due to some custom restrictions that aren't support in GORM, so it would be nice if anyone knows how to do it with Hibernate criteria.</p>
  
  <p>Right now this is what I am trying to do in Hibernate Criteria and it doesn't work(I am using postgre).</p>
  
  <pre><code>searchCriteria.add(Restrictions.sqlRestriction("to_timestamp(start_date, 'h:mm a') = ? ", timeValue, StandardBasicTypes.DATE))
  </code></pre>
  
  <p>Highly appreciate your help.</p>