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

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