Below is the hibernate query I have written:
public List<GroupTweetOrder> fetchTodayGroupOrder(Date date) {
Session session = getSessionFactory().getCurrentSession();
DateTime todayAtMidnight = new DateTime().withTimeAtStartOfDay();
DateTime tomorrowAtMidnight = todayAtMidnight.plusDays(1);
Query query = session
.getNamedQuery("findUsersOrder")
.setTimestamp("todayAtMidnight", todayAtMidnight.toDate())
.setTimestamp("tomorrowAtMidnight", tomorrowAtMidnight.toDate());
List<GroupTweetOrder> usersOrder = query.list();
return usersOrder;
}
This code is throwing exceptions, can we use some other ways to achieve the same means of recording from the database for today's date ?
This code is throwing exceptions
so it's not working, right ? – Marc-Andre Jun 26 at 14:28