Tag tag;
try {
tag = em.getReference(Tag.class, id);
tag.getId();
} catch (EntityNotFoundException enfe) {
throw new NonexistentEntityException("The tag with id " + id + " no longer exists.", enfe);
}
List<String> illegalOrphanMessages = null;
List<Coursetag> coursetagListOrphanCheck = tag.getCoursetagList();
for (Coursetag coursetagListOrphanCheckCoursetag : coursetagListOrphanCheck) {
if (illegalOrphanMessages == null) {