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