infoViewRoomSchedule.setInfoRoom(Cloner.copyRoom2InfoRoom(room)); infoViewRoomSchedule.setRoomLessons(infoLessonsList); infoViewRoomScheduleList.add(infoViewRoomSchedule);
final List lessons = lessonDAO.readByRoomAndExecutionPeriod(room, executionPeriod); final List infoLessons = new ArrayList(lessons.size()); for (final Iterator iterator2 = lessons.iterator(); iterator2.hasNext(); ) { final ILesson lesson = (ILesson) iterator2.next(); final InfoLesson infoLesson = InfoLesson.newInfoFromDomain(lesson); infoLessons.add(infoLesson);  final IRoomOccupation roomOccupation = lesson.getRoomOccupation(); final InfoRoomOccupation infoRoomOccupation = InfoRoomOccupation.newInfoFromDomain(roomOccupation); infoLesson.setInfoRoomOccupation(infoRoomOccupation);  infoRoomOccupation.setInfoRoom(infoRoom); infoLesson.setInfoSala(infoRoom);  final IPeriod period = roomOccupation.getPeriod(); final InfoPeriod infoPeriod = InfoPeriod.newInfoFromDomain(period); infoRoomOccupation.setInfoPeriod(infoPeriod);  final IShift shift = lesson.getShift(); final InfoShift infoShift = InfoShift.newInfoFromDomain(shift); infoLesson.setInfoShift(infoShift); infoLesson.setInfoShiftList(new ArrayList(1)); infoLesson.getInfoShiftList().add(infoShift);  final IExecutionCourse executionCourse = shift.getDisciplinaExecucao(); final InfoExecutionCourse infoExecutionCourse = InfoExecutionCourse.newInfoFromDomain(executionCourse); infoShift.setInfoDisciplinaExecucao(infoExecutionCourse);  infoExecutionCourse.setInfoExecutionPeriod(infoExecutionPeriod);
    public List run(List pavillions, InfoExecutionPeriod infoExecutionPeriod) {        final List infoViewRoomScheduleList = new ArrayList();        try {            ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport();            IExecutionPeriod executionPeriod = InfoExecutionPeriodWithInfoExecutionYear                    .newDomainFromInfo(infoExecutionPeriod);            ISalaPersistente roomDAO = sp.getISalaPersistente();            IAulaPersistente lessonDAO = sp.getIAulaPersistente();            // Read pavillions rooms            List rooms = roomDAO.readByPavillions(pavillions);            // Read rooms classes            for (int i = 0; i < rooms.size(); i++) {                InfoViewRoomSchedule infoViewRoomSchedule = new InfoViewRoomSchedule();                IRoom room = (IRoom) rooms.get(i);                List lessonList = lessonDAO.readByRoomAndExecutionPeriod(room, executionPeriod);                Iterator iterator = lessonList.iterator();                List infoLessonsList = new ArrayList();                while (iterator.hasNext()) {                    ILesson elem = (ILesson) iterator.next();                    InfoLesson infoLesson = Cloner.copyILesson2InfoLesson(elem);                    IShift shift = elem.getShift();                    if (shift == null) {                        continue;                    }                    InfoShift infoShift = InfoShift.newInfoFromDomain(shift);                    infoLesson.setInfoShift(infoShift);                    infoLessonsList.add(infoLesson);                }                infoViewRoomSchedule.setInfoRoom(Cloner.copyRoom2InfoRoom(room));                infoViewRoomSchedule.setRoomLessons(infoLessonsList);                infoViewRoomScheduleList.add(infoViewRoomSchedule);            }        } catch (ExcepcaoPersistencia ex) {            ex.printStackTrace();        }        return infoViewRoomScheduleList;    }