@RequiresSession
  public List<AlertDefinitionEntity> findBySourceType(Long clusterId, SourceType sourceType) {
    return daoUtils.selectList(
      entityManagerProvider.get()
        .createNamedQuery("AlertDefinitionEntity.findBySourceType", AlertDefinitionEntity.class)
        .setParameter("clusterId", clusterId)
        .setParameter("sourceType", sourceType));
  }
@return all definitions with the given sourceType
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java