title: Hibernate Query to fetch records on date ignoring timestamp
body: <p>I have a timestamp column tradedate in one of the DB(Oracle) tables.
  I am using hibernate as the persistence layer to fetch and store Data to DB.
  I have a requirement in which I need to query the DB on date. 
  i.e From UI the user passes a date and I need to get the filtered data based on this date.</p>
  
  <p>If the tradedate column only has the date part my query returns the correct records
  The issue arises when the tradedate column is populated with a timestamp value ie(date + time). Then those values are not returned by the query.</p>
  
  <p>eg:say there are 10 records for 23rd Oct 2010 in DB 5 of them have the timestamp entries and 5 dont</p>
  
  <p>So the query which i have returns me only the 5 rows which dont have timestamp.</p>
  
  <p>Now i know that i need to extract date from the timestamp and then do the comparision so that i get all the records for aprticular date but i dont know how its done with Hibernate and using HQL</p>
  
  <p>the query in <strong>Java/Hibernate</strong> that i am using is as follows</p>
  
  <p>String hql = "select Clearing from POJO as POJO where POJO.tradeDate = :date";
  Query query = getSession().createQuery(hql);
  query.setParameter("date", date); </p>