@RequiresSession
  public AlertTargetEntity findTargetByName(String targetName) {
    TypedQuery<AlertTargetEntity> query = entityManagerProvider.get().createNamedQuery(
        "AlertTargetEntity.findByName", AlertTargetEntity.class);

    query.setParameter("targetName", targetName);

    return daoUtils.selectSingle(query);
  }
Gets an alert target with the specified name. Alert target names are unique
across all clusters.

@param targetName
         the name of the target (not {@code null}).
@return the alert target or {@code null} if none exists.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java