public PublicHolidaysVoCollection getPublicHolidays() { DomainFactory factory = getDomainFactory(); List exceptionDates = factory.find("from PublicHolidays as ph order by ph.date asc ");// WDEV-15083 if(exceptionDates != null && exceptionDates.size() > 0) return PublicHolidaysVoAssembler.createPublicHolidaysVoCollectionFromPublicHolidays(exceptionDates); return null; }
public PublicHolidaysVo savePublicHolidays(PublicHolidaysVo voPublicHolidays) throws StaleObjectException { //Ensure the value object has been validated if (!voPublicHolidays.isValidated()) throw new DomainRuntimeException("Public Holidays has not been validated"); DomainFactory factory = getDomainFactory(); PublicHolidays domPublicHolidays = PublicHolidaysVoAssembler.extractPublicHolidays(factory, voPublicHolidays); factory.save(domPublicHolidays); return PublicHolidaysVoAssembler.create(domPublicHolidays); }