Beispiel #1
0
  private String buildTableOptions(Table table) {
    StringBuilder options = new StringBuilder();
    addCommonOptions(options, table);

    if (table.isMaterialized()) {
      addOption(options, MATERIALIZED, table.isMaterialized());
      if (table.getMaterializedTable() != null) {
        addOption(options, MATERIALIZED_TABLE, table.getMaterializedTable().getName());
      }
    }
    if (table.supportsUpdate()) {
      addOption(options, UPDATABLE, table.supportsUpdate());
    }
    if (table.getCardinality() != -1) {
      if (table.getCardinality() != table.getCardinalityAsFloat()) {
        addOption(options, CARDINALITY, (long) table.getCardinalityAsFloat());
      } else {
        addOption(options, CARDINALITY, table.getCardinality());
      }
    }
    if (!table.getProperties().isEmpty()) {
      for (String key : table.getProperties().keySet()) {
        addOption(options, key, table.getProperty(key, false));
      }
    }
    return options.toString();
  }