public AlertDefinitionEntity merge(AlertDefinition definition,
      AlertDefinitionEntity entity) {

    entity.setComponentName(definition.getComponentName());
    entity.setDefinitionName(definition.getName());
    entity.setEnabled(definition.isEnabled());
    entity.setHostIgnored(definition.isHostIgnored());
    entity.setLabel(definition.getLabel());
    entity.setDescription(definition.getDescription());
    entity.setScheduleInterval(definition.getInterval());
    entity.setHelpURL(definition.getHelpURL());
    entity.setServiceName(definition.getServiceName());

    Scope scope = definition.getScope();
    if (null == scope) {
      scope = Scope.ANY;
    }

    entity.setScope(scope);

    return mergeSource(definition.getSource(), entity);
  }
Merges the specified {@link AlertDefinition} into the
{@link AlertDefinitionEntity}, leaving any fields not merged intact.
<p/>
The merged entity will have a new UUID.

@param definition
         the definition to merge into the entity (not {@code null}).
@param entity
         the entity to merge into (not {@code null}).
@return a merged, but not yes persisted entity, or {@code null} if the
        merge could not be done.
ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionFactory.java