public void createOrUpdate(AlertDefinitionEntity alertDefinition)
      throws AmbariException {
    if (null == alertDefinition.getDefinitionId()) {
      create(alertDefinition);
    } else {
      merge(alertDefinition);
    }
  }
Creates or updates the specified entity. This method will check
{@link AlertDefinitionEntity#getDefinitionId()} in order to determine
whether the entity should be created or merged.

@param alertDefinition
         the definition to create or update (not {@code null}).
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java