illegalOrphanMessages = new ArrayList<String>();
}
illegalOrphanMessages.add("This Courses (" + courses + ") cannot be destroyed since the Enrollment " + enrollmentListOrphanCheckEnrollment + " in its enrollmentList field has a non-nullable courseId field.");
}
if (illegalOrphanMessages != null) {
throw new IllegalOrphanException(illegalOrphanMessages);
}
User createrUserId = courses.getCreaterUserId();
if (createrUserId != null) {
createrUserId.getCoursesList().remove(courses);
createrUserId = em.merge(createrUserId);