01: package liquibase.database.sql;
02:
03: import java.util.ArrayList;
04: import java.util.Arrays;
05: import java.util.Collections;
06: import java.util.List;
07:
08: public class PrimaryKeyConstraint implements ColumnConstraint {
09:
10: private String constraintName;
11:
12: private List<String> columns = new ArrayList<String>();
13:
14: public PrimaryKeyConstraint() {
15: }
16:
17: public PrimaryKeyConstraint(String constraintName) {
18: this .constraintName = constraintName;
19: }
20:
21: public String getConstraintName() {
22: return constraintName;
23: }
24:
25: public List<String> getColumns() {
26: return Collections.unmodifiableList(columns);
27: }
28:
29: public PrimaryKeyConstraint addColumns(String... columns) {
30: this.columns.addAll(Arrays.asList(columns));
31:
32: return this;
33: }
34: }
|