Hibernate 3.0
Oracle 9i
Hi,
I have a field in database of type Date. The same has been mapped as java.util.Date .
> There are dates in my database with no time stamp( e.g '02-Sep-2005').
criteria.add(Expression.between("dueDate",calendar.getTime(),calendar2.getTime()));
translated to : (between Fri Sep 02 00:00:00 GMT+05:30 2005 and Sat Sep 03 00:00:00 GMT+05:30 2005)
When I query the database for the date ('02-Sep-2005') , the row is not returned. If we change the value in the database to a one with time stamp , the above works fine.
The same does not happen if we use a SQL. Can you suggest what is the best way to get the data as the data can contain time stamp or may not contain time stamp .
Thanks
Ritesh
|