| 1 | |
package liquibase.statement; |
| 2 | |
|
| 3 | |
import java.util.ArrayList; |
| 4 | |
import java.util.Arrays; |
| 5 | |
import java.util.Collections; |
| 6 | |
import java.util.List; |
| 7 | |
|
| 8 | |
public class PrimaryKeyConstraint implements ColumnConstraint { |
| 9 | |
|
| 10 | |
private String constraintName; |
| 11 | |
|
| 12 | |
|
| 13 | |
private String tablespace; |
| 14 | |
|
| 15 | 63 | private List<String> columns = new ArrayList<String>(); |
| 16 | |
|
| 17 | 0 | public PrimaryKeyConstraint() { |
| 18 | 0 | } |
| 19 | |
|
| 20 | 63 | public PrimaryKeyConstraint(String constraintName) { |
| 21 | 63 | this.constraintName = constraintName; |
| 22 | 63 | } |
| 23 | |
|
| 24 | |
public String getConstraintName() { |
| 25 | 0 | return constraintName; |
| 26 | |
} |
| 27 | |
|
| 28 | |
public String getTablespace() { |
| 29 | 0 | return tablespace; |
| 30 | |
} |
| 31 | |
|
| 32 | |
public void setTablespace(String tablespace) { |
| 33 | 1 | this.tablespace = tablespace; |
| 34 | 1 | } |
| 35 | |
|
| 36 | |
public List<String> getColumns() { |
| 37 | 2 | return Collections.unmodifiableList(columns); |
| 38 | |
} |
| 39 | |
|
| 40 | |
public PrimaryKeyConstraint addColumns(String... columns) { |
| 41 | 1 | this.columns.addAll(Arrays.asList(columns)); |
| 42 | |
|
| 43 | 1 | return this; |
| 44 | |
} |
| 45 | |
} |