|
|
|
@ -29,6 +29,7 @@ import javax.annotation.Nullable;
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -172,6 +173,7 @@ public class Schema implements Serializable {
|
|
|
|
|
for (Column col : columns) {
|
|
|
|
|
nameToColumns.put(col.getName(), col);
|
|
|
|
|
}
|
|
|
|
|
nameToColumns = Collections.unmodifiableMap(nameToColumns);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -210,14 +212,16 @@ public class Schema implements Serializable {
|
|
|
|
|
public static final class Builder {
|
|
|
|
|
|
|
|
|
|
private List<Column> columns;
|
|
|
|
|
private List<String> primaryKeys = new ArrayList<>();
|
|
|
|
|
private Map<String, String> options = new HashMap<>();
|
|
|
|
|
private List<String> primaryKeys;
|
|
|
|
|
private final Map<String, String> options;
|
|
|
|
|
private @Nullable String comment;
|
|
|
|
|
|
|
|
|
|
// Used to check duplicate columns
|
|
|
|
|
private final Set<String> columnNames;
|
|
|
|
|
|
|
|
|
|
public Builder() {
|
|
|
|
|
this.primaryKeys = new ArrayList<>();
|
|
|
|
|
this.options = new HashMap<>();
|
|
|
|
|
this.columns = new ArrayList<>();
|
|
|
|
|
this.columnNames = new HashSet<>();
|
|
|
|
|
}
|
|
|
|
|