@RequiresSession
  public AlertGroupEntity findGroupByName(long clusterId, String groupName) {
    TypedQuery<AlertGroupEntity> query = entityManagerProvider.get().createNamedQuery(
        "AlertGroupEntity.findByNameInCluster", AlertGroupEntity.class);

    query.setParameter("clusterId", clusterId);
    query.setParameter("groupName", groupName);

    return daoUtils.selectSingle(query);
  }
Gets an alert group with the specified name for the given cluster. Alert
group names are unique within a cluster.

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