Tagcorrelations tagcorrelations;
try {
tagcorrelations = em.getReference(Tagcorrelations.class, id);
tagcorrelations.getId();
} catch (EntityNotFoundException enfe) {
throw new NonexistentEntityException("The tagcorrelations with id " + id + " no longer exists.", enfe);
}
Tag referencedTagId = tagcorrelations.getReferencedTagId();
if (referencedTagId != null) {
referencedTagId.getTagcorrelationsList().remove(tagcorrelations);
referencedTagId = em.merge(referencedTagId);