title: hibernate restriction on date issue
body: <p>I am facing issue in hibernate criteria restriction. I have data in db2 table as 2014-03-05 20:07:33 and I am trying to fetch data based on the below criteria:</p>
  
  <pre><code>hibernateCriteria.add(Restrictions.ge("eventTs",
              getLowerBoundDate(adminReportsBeanDTO.getFromDate())));
      hibernateCriteria.add(Restrictions.le("eventTs",
              getUpperBoundDate(adminReportsBeanDTO.getToDate())));
  public static Date getLowerBoundDate(Date fromDate) {
      Calendar cal = Calendar.getInstance();
      cal.setTime(fromDate);
      cal.set(Calendar.HOUR_OF_DAY, 0);
      cal.set(Calendar.MINUTE, 0);
      cal.set(Calendar.SECOND, 0);
      cal.set(Calendar.MILLISECOND, 0);
      return cal.getTime();
  }
  
  /**
   * 
   * @param fromDate
   * @return
   */
  public static Date getUpperBoundDate(Date toDate) {
      Calendar cal = Calendar.getInstance();
      cal.setTime(toDate);
      cal.set(Calendar.HOUR_OF_DAY, 23);
      cal.set(Calendar.MINUTE, 59);
      cal.set(Calendar.SECOND, 59);
      cal.set(Calendar.MILLISECOND, 999);
      return cal.getTime();
  }
  </code></pre>
  
  <p>and from date is as Wed Mar 05 00:00:00 IST 2014 and to date is Wed Mar 05 23:59:59 IST 2014</p>
  
  <p>and I have records in the table for the above date but it is not displaying. But the report is displaying for the next date 6th march.</p>
  
  <p>here is my hibernate criteria</p>
  
  <pre><code>CriteriaImpl(com.gtech.lsp.beans.Audit:this[][eventTs&gt;=Wed Mar 05 00:00:00 IST 2014,            eventTs&lt;=Wed Mar 05 23:59:59 IST 2014])
  </code></pre>
  
  <p>Please help me on this.</p>