private HospitalAtNightListandDatesVo getCurrentHospitalNightList(HospitalAtNightCutOverPointsConfigRefVo hospitalConfig, DateTime startDateTime, DateTime endDateTime) { DomainFactory factory = getDomainFactory(); String query = "select h from HospitalAtNightListandDates as h where h.cutOverPoints.id = :HospitalConfig and h.shiftStartDate = :StartDate and h.shiftEndDate = :EndDate"; List<?> list = factory.find(query, new String[] {"HospitalConfig", "StartDate", "EndDate"}, new Object[] {hospitalConfig.getID_HospitalAtNightCutOverPointsConfig(), startDateTime.getJavaDate(), endDateTime.getJavaDate()}); HospitalAtNightListandDatesVoCollection currentList = HospitalAtNightListandDatesVoAssembler.createHospitalAtNightListandDatesVoCollectionFromHospitalAtNightListandDates(list); if(currentList == null || currentList.size() == 0) return null; return currentList.get(0); }