title: Hibernate Criteria for Dates
body: <p>In oracle I have dates in format </p>
  
  <p>17-April-2011 19:20:23.707000000</p>
  
  <p>I would like to retrieve all orders for 17-04-2011.</p>
  
  <pre><code> SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-YYYY");
  String myDate = "17-04-2011";
  Date date = formatter.parse(myDate);
      Criteria criteria = 
                  session.createCriteria(Order.class);
  Criterion restrictDate = Restrictions.like("orderDate",date); 
  </code></pre>
  
  <p>but it brings me empty result:</p>