public static void deleteAttend(IEnrolment enrolment)
public static void deleteAttend(IEnrollment enrolment)
    public static void deleteAttend(IEnrolment enrolment)            throws ExcepcaoPersistencia    {        ISuportePersistente persistentSuport = SuportePersistenteOJB                .getInstance();        IPersistentExecutionCourse executionCourseDAO = persistentSuport                .getIPersistentExecutionCourse();        IFrequentaPersistente attendDAO = persistentSuport                .getIFrequentaPersistente();        IPersistentMark markDAO = persistentSuport.getIPersistentMark();        IPersistentStudentGroupAttend studentGroupAttendDAO = persistentSuport                .getIPersistentStudentGroupAttend();        ITurnoAlunoPersistente shiftStudentDAO = persistentSuport                .getITurnoAlunoPersistente();        List executionCourses = executionCourseDAO                .readbyCurricularCourseAndExecutionPeriod(enrolment                        .getCurricularCourse(), enrolment.getExecutionPeriod());        Iterator iterator = executionCourses.iterator();        while (iterator.hasNext())		{			IExecutionCourse executionCourse = (IExecutionCourse) iterator.next();	        if (executionCourse != null)	        {	            IFrequenta attend = attendDAO.readByAlunoAndDisciplinaExecucao(	                    enrolment.getStudentCurricularPlan().getStudent(),	                    executionCourse);	            if (attend != null)	            {	                List marks = markDAO.readBy(attend);	                if (marks == null || marks.isEmpty())	                {	                    IStudentGroupAttend studentGroupAttend = studentGroupAttendDAO	                            .readBy(attend);	                    if (studentGroupAttend == null)	                    {	                        List shiftsStudentIsIn = shiftStudentDAO	                                .readByStudent(enrolment	                                        .getStudentCurricularPlan()	                                        .getStudent());	                        if (shiftsStudentIsIn == null	                                || shiftsStudentIsIn.isEmpty())	                        {	                            attendDAO.deleteByOID(Frequenta.class, attend	                                    .getIdInternal());	                        }	                        else	                        {	                            attendDAO.simpleLockWrite(attend);	                            attend.setEnrolment(null);	                        }	                    }	                    else	                    {	                        attendDAO.simpleLockWrite(attend);	                        attend.setEnrolment(null);	                    }	                }	                else	                {	                    attendDAO.simpleLockWrite(attend);	                    attend.setEnrolment(null);	                }	            }	        }	    }    }