DiaSemana dayOfWeek, Integer frequency, Integer week, IRoomOccupation oldroomOccupation) throws FenixServiceException { try { ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport(); List roomOccupationInDBList = sp.getIPersistentRoomOccupation().readAll();
DiaSemana dayOfWeek, Integer frequency, Integer week, IRoom room, IRoomOccupation oldroomOccupation) throws FenixServiceException, ExcepcaoPersistencia { final ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport(); final List<IRoomOccupation> roomOccupations = room.getRoomOccupations();
    private boolean validNoInterceptingLesson(Calendar startTime, Calendar endTime,            DiaSemana dayOfWeek, Integer frequency, Integer week, IRoomOccupation oldroomOccupation) throws FenixServiceException {        try {            ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport();            List roomOccupationInDBList = sp.getIPersistentRoomOccupation().readAll();            Iterator iter = roomOccupationInDBList.iterator();            while (iter.hasNext()) {                IRoomOccupation roomOccupationInDB = (IRoomOccupation) iter.next();                if (roomOccupationInDB.equals(oldroomOccupation)) {                    continue;                }                if (roomOccupationInDB.roomOccupationForDateAndTime(oldroomOccupation.getPeriod(), startTime, endTime, dayOfWeek, frequency, week, oldroomOccupation.getRoom())) {                    return false;                }            }            return true;        } catch (ExcepcaoPersistencia ex) {            throw new FenixServiceException(ex);        }    }