@RequiresSession
  private AlertCurrentEntity findCurrentByHostAndNameInJPA(long clusterId, String hostName,
      String alertName) {
    TypedQuery<AlertCurrentEntity> query = m_entityManagerProvider.get().createNamedQuery(
      "AlertCurrentEntity.findByHostAndName", AlertCurrentEntity.class);

    query.setParameter("clusterId", Long.valueOf(clusterId));
    query.setParameter("hostName", hostName);
    query.setParameter("definitionName", alertName);

    return m_daoUtils.selectOne(query);
  }
Locate the current alert for the provided service and alert name.

@param clusterId
         the cluster id
@param hostName
         the name of the host (not {@code null}).
@param alertName
         the name of the alert (not {@code null}).
@return the current record, or {@code null} if not found
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java