Courses courses;
try {
courses = em.getReference(Courses.class, id);
courses.getCourseId();
} catch (EntityNotFoundException enfe) {
throw new NonexistentEntityException("The courses with id " + id + " no longer exists.", enfe);
}
List<String> illegalOrphanMessages = null;
List<Enrollment> enrollmentListOrphanCheck = courses.getEnrollmentList();
for (Enrollment enrollmentListOrphanCheckEnrollment : enrollmentListOrphanCheck) {
if (illegalOrphanMessages == null) {