illegalOrphanMessages.add("This Coursetag (" + coursetag + ") cannot be destroyed since the Tagrates " + tagratesListOrphanCheckTagrates + " in its tagratesList field has a non-nullable courseTagId field.");
}
if (illegalOrphanMessages != null) {
throw new IllegalOrphanException(illegalOrphanMessages);
}
Courses courseId = coursetag.getCourseId();
if (courseId != null) {
courseId.getCoursetagList().remove(coursetag);
courseId = em.merge(courseId);
}
Tag tagId = coursetag.getTagId();
if (tagId != null) {
tagId.getCoursetagList().remove(coursetag);