Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DAO:
- /**
- * Returns the appointment blocks corresponding to the given date and location.
- *
- * @param date the date to filter by.
- * @param location the location to filter by.
- * @return the appointment blocks that is on the given date and location.
- */
- @Override
- @Transactional(readOnly = true)
- public List<AppointmentBlock> getAppointmentBlocks(Date fromDate, Date toDate, Location location) {
- Criteria criteria = sessionFactory.getCurrentSession().createCriteria(AppointmentBlock.class);
- if (location != null)
- criteria.add(Restrictions.eq("location", location));
- if (fromDate != null)
- criteria.add(Restrictions.ge("startDate", fromDate));
- if (toDate != null)
- criteria.add(Restrictions.le("endDate", toDate));
- return criteria.list();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement