private Database convertToDatabase(MDatabase mdb) {
    Database db = new Database();
    db.setName(mdb.getName());
    db.setDescription(mdb.getDescription());
    db.setParameters(convertMap(mdb.getParameters()));
    db.setOwnerName(mdb.getOwnerName());
    String type = org.apache.commons.lang3.StringUtils.defaultIfBlank(mdb.getOwnerType(), null);
    PrincipalType principalType = (type == null) ? null : PrincipalType.valueOf(type);
    db.setOwnerType(principalType);
    if (mdb.getType().equalsIgnoreCase(DatabaseType.NATIVE.name())) {
      db.setType(DatabaseType.NATIVE);
      db.setLocationUri(mdb.getLocationUri());
      db.setManagedLocationUri(org.apache.commons.lang3.StringUtils.defaultIfBlank(mdb.getManagedLocationUri(), null));
    } else {
      db.setType(DatabaseType.REMOTE);
      db.setConnector_name(org.apache.commons.lang3.StringUtils.defaultIfBlank(mdb.getDataConnectorName(), null));
      db.setRemote_dbname(org.apache.commons.lang3.StringUtils.defaultIfBlank(mdb.getRemoteDatabaseName(), null));
    }
    db.setCatalogName(mdb.getCatalogName());
    db.setCreateTime(mdb.getCreateTime());
    return db;
  }
Alter the database object in metastore. Currently only the parameters
of the database or the owner can be changed.
@param dbName the database name
@param db the Hive Database object
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java