Hi,
Who can we set Restrictions base on date in DetachedCriteria.
For instance
I have date type in oracle database which is of format YYYY-MM-DD HH:MM:SS and i would like to get all result which is greater than or equal to current date.
DetachedCriteria dc = DetachedCriteria.forClass(Product.class);
dc.add(Restrictions.ge("expDate", current Date));
List<NotExpiredProducts> notExpProducts= getHibernateTemplate().findByCriteria(dc);
Any sample code if possible.
Any help would be greatly appricated.
|