@RequiresSession
  public List<AlertCurrentEntity> findCurrentByDefinitionId(long definitionId) {
    TypedQuery<AlertCurrentEntity> query = m_entityManagerProvider.get().createNamedQuery(
        "AlertCurrentEntity.findByDefinitionId", AlertCurrentEntity.class);

    query.setParameter("definitionId", Long.valueOf(definitionId));

    List<AlertCurrentEntity> alerts = m_daoUtils.selectList(query);

    // if caching is enabled, replace results with cached values when present
    if (m_configuration.isAlertCacheEnabled()) {
      alerts = supplementWithCachedAlerts(alerts);
    }

    return alerts;
  }
Gets the current alerts for the specified definition ID.

@param definitionId
         the ID of the definition to retrieve current alerts for.
@return the current alerts for the definition or an empty list if none
        exist (never {@code null}).
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java