if (examEnrollments != null || !examEnrollments.isEmpty()) { throw new notAuthorizedPersistentDeleteException();
if (examEnrollments != null && !examEnrollments.isEmpty()) { throw new notAuthorizedPersistentDeleteException();
	public void delete(IExam exam) throws ExcepcaoPersistencia {				Criteria criteria = new Criteria();		criteria.addEqualTo("keyExam", exam.getIdInternal());		List examEnrollments = queryList(ExamStudentRoom.class, criteria);		if (examEnrollments != null || !examEnrollments.isEmpty()) {		throw new notAuthorizedPersistentDeleteException();		}		else{			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);		}	}