if (exam.getStudentsEnrolled() != null || exam.getStudentsEnrolled().isEmpty()) {
Criteria criteria = new Criteria(); criteria.addEqualTo("exam.idInternal", exam.getIdInternal()); List examEnrollments = queryList(ExamStudentRoom.class, criteria); if (examEnrollments != null || !examEnrollments.isEmpty()) {
	public void delete(IExam exam) throws ExcepcaoPersistencia {		// TODO : Return indication if exam can be romoved or not.		if (exam.getStudentsEnrolled() != null			|| exam.getStudentsEnrolled().isEmpty()) {			List associatedExecutionCourses =				exam.getAssociatedExecutionCourses();			if (associatedExecutionCourses != null) {				for (int i = 0; i < associatedExecutionCourses.size(); i++) {					IDisciplinaExecucao executionCourse =						(IDisciplinaExecucao) associatedExecutionCourses.get(i);					executionCourse.getAssociatedExams().remove(exam);					IExamExecutionCourse examExecutionCourseToDelete =						SuportePersistenteOJB							.getInstance()							.getIPersistentExamExecutionCourse()							.readBy(							exam,							executionCourse);					SuportePersistenteOJB						.getInstance()						.getIPersistentExamExecutionCourse()						.delete(						examExecutionCourseToDelete);				}			}			exam.setAssociatedExecutionCourses(null);			super.delete(exam);		}	}