@Override
  public AmbariConfigurationEntity merge(AmbariConfigurationEntity entity) {
    AmbariConfigurationEntity foundEntity = findByPK(new AmbariConfigurationEntityPK(entity.getCategoryName(), entity.getPropertyName()));
    if (foundEntity == null) {
      String message = String.format("The configuration entry for the category %s and name %s does not exist", entity.getCategoryName(), entity.getPropertyName());
      LOGGER.debug(message);
      throw new EntityNotFoundException(message);
    }

    AmbariConfigurationEntity updatedEntity = entity;

    if (!StringUtils.equals(foundEntity.getPropertyValue(), entity.getPropertyValue())) {
      // updating the existing entity
      updatedEntity = super.merge(entity);
      entityManagerProvider.get().flush();
    }

    return updatedEntity;
  }
Removes the Ambari configuration properties with the requested category name from the database.

@param categoryName the configuration category name
@return the number of items removed
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAO.java