I want to search for a record with Date as the criteria.
I am doing:- Criteria criteria = session.createCriteria(MyClass.class); criteria.add(Expression.eq("columnName", dateValue));
This is trying to equate the two dates with time also. I want that only date should be compared and not the time.
For e.g. I have a row in database -- 10/05/2009 5:30:00 AM and my search criteria value(dateValue) is - 10/05/2009 00:00:00 AM
In this case the Expression criteria is not equal to the record in db so this record id not fetched.
How to ignore the time in - criteria.add(Expression.eq("columnName", dateValue));
Thanks
|