try { ISuportePersistente sp = SuportePersistenteOJB.getInstance(); IPersistentStudent persistentStudent = sp.getIPersistentStudent(); IStudent student = persistentStudent.readByUsername(username); ITurnoAlunoPersistente persistentShiftStudent = sp.getITurnoAlunoPersistente(); IPersistentExecutionPeriod persistentExecutionPeriod = sp.getIPersistentExecutionPeriod(); IExecutionPeriod executionPeriod = persistentExecutionPeriod.readActualExecutionPeriod(); List studentShifts = persistentShiftStudent.readByStudentAndExecutionPeriod(student, executionPeriod);  List lessons = new ArrayList(); Iterator shiftIter = studentShifts.iterator(); while (shiftIter.hasNext()) { ITurnoAluno shiftStudent = (ITurnoAluno) shiftIter.next(); ITurno shift = shiftStudent.getShift(); lessons.addAll(shift.getAssociatedLessons()); }  Iterator iter = lessons.iterator(); List infoLessons = new ArrayList(); while (iter.hasNext()) { IAula lesson = (IAula) iter.next(); InfoLesson infolesson = copyILesson2InfoLesson(lesson); ITurno shift = lesson.getShift(); InfoShift infoShift = Cloner.copyShift2InfoShift(shift); infolesson.setInfoShift(infoShift); infoLessons.add(infolesson); }  return infoLessons; } catch (ExcepcaoPersistencia e) { throw new FenixServiceException(e);
List lessons = new ArrayList(); Iterator shiftIter = studentShifts.iterator(); while (shiftIter.hasNext()) { ITurnoAluno shiftStudent = (ITurnoAluno) shiftIter.next(); ITurno shift = shiftStudent.getShift(); lessons.addAll(shift.getAssociatedLessons());
    public List run(String username) throws FenixServiceException {        try {            ISuportePersistente sp = SuportePersistenteOJB.getInstance();            IPersistentStudent persistentStudent = sp.getIPersistentStudent();            IStudent student = persistentStudent.readByUsername(username);            ITurnoAlunoPersistente persistentShiftStudent = sp.getITurnoAlunoPersistente();            IPersistentExecutionPeriod persistentExecutionPeriod = sp.getIPersistentExecutionPeriod();            IExecutionPeriod executionPeriod = persistentExecutionPeriod.readActualExecutionPeriod();            List studentShifts = persistentShiftStudent.readByStudentAndExecutionPeriod(student,                    executionPeriod);            List lessons = new ArrayList();            Iterator shiftIter = studentShifts.iterator();            while (shiftIter.hasNext()) {                ITurnoAluno shiftStudent = (ITurnoAluno) shiftIter.next();                ITurno shift = shiftStudent.getShift();                lessons.addAll(shift.getAssociatedLessons());            }            Iterator iter = lessons.iterator();            List infoLessons = new ArrayList();            while (iter.hasNext()) {                IAula lesson = (IAula) iter.next();                InfoLesson infolesson = copyILesson2InfoLesson(lesson);                ITurno shift = lesson.getShift();                InfoShift infoShift = Cloner.copyShift2InfoShift(shift);                infolesson.setInfoShift(infoShift);                infoLessons.add(infolesson);            }            return infoLessons;        } catch (ExcepcaoPersistencia e) {            throw new FenixServiceException(e);        }    }