Hibernate version: 3.2.0
Name and version of the database you are using: Oracle 10.2
I have a table with events. In that table there is a date column. In there the date and time is stored when the event has happened. Now I want to get all the events that happened between 10:00 and 12:00 on any day.
I try to do this by creating a Criteria.
Code:
Criteria criteria = createCriteria();
criteria.add(Expression.between("extract(hour from {alias}.EVENT_DATE)",
startMorning, endMorning);
startMorning and endMorning are 2 Long variables that contain the time in milliseconds. What do I need to put in the place of hour in the extract function or is there a better way to get to the result?
Thanks in advance,
Marco