List attends = persistentAttend.readByStudentNumber(student.getNumber());
List attends = persistentAttend.readByStudentNumber(student.getNumber(), student.getDegreeType());
    public Boolean run(InfoStudent infoStudent, List infoExecutionCourseIds)            throws FenixServiceException {        try {            ISuportePersistente sp = SuportePersistenteOJB.getInstance();            IPersistentStudent persistentStudent = sp.getIPersistentStudent();            IFrequentaPersistente persistentAttend = sp.getIFrequentaPersistente();            IPersistentExecutionCourse persistentExecutionCourse = sp.getIPersistentExecutionCourse();            if (infoStudent == null) {                return new Boolean(false);            }            if (infoExecutionCourseIds == null) {                infoExecutionCourseIds = new ArrayList();            }            IStudent student = persistentStudent.readStudentByNumberAndDegreeType(infoStudent                    .getNumber(), infoStudent.getDegreeType());            //Read every course the student attends to:            List attends = persistentAttend.readByStudentNumber(student.getNumber());            List attendingCourses = getExecutionCoursesFromAttends(attends);            //Gets the database objects for the wanted courses            List wantedAttendingCourses = new ArrayList();            Iterator i = infoExecutionCourseIds.iterator();            while (i.hasNext()) {                IExecutionCourse executionCourse = (IExecutionCourse) persistentExecutionCourse                        .readByOID(ExecutionCourse.class, (Integer) i.next());                if (executionCourse == null) {                    throw new FenixServiceException("nullExecutionCourseId");                }                wantedAttendingCourses.add(executionCourse);            }            //Delete all courses the student is currently attending to that            // he/she doesn't want to:            //attendings to remove :            List attendsToRemove = (List) CollectionUtils.subtract(attendingCourses,                    wantedAttendingCourses);            List attendingCoursesToAdd = (List) CollectionUtils.subtract(wantedAttendingCourses,                    attendingCourses);            if (attendsToRemove != null && !attendsToRemove.isEmpty()) {                deleteAttends(attendsToRemove, student, sp, persistentAttend);            }            //Add new courses (without duplicates)            i = attendingCoursesToAdd.iterator();            while (i.hasNext()) {                IExecutionCourse executionCourse = (IExecutionCourse) i.next();                IFrequenta attendsEntry = persistentAttend.readByAlunoAndDisciplinaExecucao(student,                        executionCourse);                if (attendsEntry == null) {                    attendsEntry = new Frequenta();                    persistentAttend.simpleLockWrite(attendsEntry);                    attendsEntry.setAluno(student);                    attendsEntry.setDisciplinaExecucao(executionCourse);                }            }        } catch (ExcepcaoPersistencia e) {            e.printStackTrace();            throw new FenixServiceException(e);        }        return new Boolean(true);    }