Hi,
suppose we have an Oracle table
create table test (
named_interval varchar2(20),
begindate date,
enddate date
);
selecting all the record which are currently 'actif' would be
select named_interval from test
where sysdate between begindate and enddate
how can I do this in hibernate ? I looked at the Criteria.between clause but this does the opposite and sysdate will not be accepted by hibernate as it is no 'test'-table column.
something like:
public Some getAll() {
Criteria criteria = session.createCriteria(Some.class);
criteria.add(Expression.between("sysdate", "begindate", "enddate"));
List myItems = criteria.list();
...
}
Jan
|