Hi ,
let's say i have this sql which is comparing only date without time against oracle
select * from some_table where to_char(creation_date,'yyyymmdd') = '20060606'
/
select * from some_table where creation_date = to_date('20060606','yyyymmdd')
Both are working but when i use Criteria API in Hibernate it does not work
I believe this because when i construct the Date() in Java it appends the time as well
How do i ignore the time and construct it and pass it to Criteria
Can give me example.
Thanks.
below are my Criteria Code
Code:
Criteria criteria = session.createCriteria(some_table.class);
criteria.add(Restrictions.eq("creation_date",DATE OBJECT);