/** * Gets an alert definition with the specified name. Alert definition names are unique within a * cluster. * * @param clusterId the ID of the cluster. * @param definitionName the name of the definition (not {@code null}). * @return the alert definition or {@code null} if none exists. */ public AlertDefinitionEntity findByName(long clusterId, String definitionName) { TypedQuery<AlertDefinitionEntity> query = entityManagerProvider .get() .createNamedQuery("AlertDefinitionEntity.findByName", AlertDefinitionEntity.class); query.setParameter("clusterId", clusterId); query.setParameter("definitionName", definitionName); return daoUtils.selectSingle(query); }