select * from tableA where trunc(order_date) > sysdate -7;
Something like
Criteria criteria = getSession().createCriteria(TableA.class).
add(Restrictions.gt("orderDate", afterSubtracting7DaysFromToday));
select * from tableA where trunc(order_date) > sysdate -7;
Something like
Criteria criteria = getSession().createCriteria(TableA.class).
add(Restrictions.gt("orderDate", afterSubtracting7DaysFromToday));
Use sqlRestriction to execute sql database functions. Something like this:
Criteria criteria = getSession().createCriteria(TableA.class).
.add(Restrictions.sqlRestriction("trunc(order_date) > sysdate -7"));