Hello I am using hibernate in my example.For bean Table Audit Trial I want to fetch audit trial between a date range with inclusion of upper & lower limits. My code is l
add one more day to end date
@Autowired
private SessionFactory sessionFactory;
String startDate = "2019-07-31 ";
String endDate = "2019-08-24 ";
Date fromDate = format.parse(fromDate);
/* Add one more day to the end date*/
Date to =format.parse(endDate);
Calendar today = Calendar.getInstance();
today.setTime(dateto);
today.add(Calendar.DAY_OF_YEAR, 1);
Date toDate= format.parse(format.format(today.getTime()));
Criteria crit = sessionFactory.getCurrentSession().createCriteria(model.class);
crit.add(Restrictions.between("dateFieldName", fromDate, toDate));
List result = crit.list();