最佳答案
您可以反过来转换它并比较’date’> =(NOW – 1天).
假设你有一个带有date属性的映射MyTable类:
Calendar c = Calendar.getInstance();
c.add(Calendar.DATE,-1);
Criteria criteria = session.createCriteria(MyTable.class);
criteria.add(Restrictions.ge("date",c.getTime());
List results = criteria.list();