@PreRemove
  public void preRemove() {
    Set<AlertGroupEntity> groups = getAlertGroups();
    if (!groups.isEmpty()) {
      for (AlertGroupEntity group : groups) {
        group.removeAlertTarget(this);
      }
    }
  }
Called before {@link EntityManager#remove(Object)} for this entity, removes
the non-owning relationship between targets and groups.
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertTargetEntity.java