01: package liquibase.database.sql;
02:
03: public class ForeignKeyConstraint implements ColumnConstraint {
04: private String foreignKeyName;
05: private String column;
06: private String references;
07: private boolean deleteCascade = false;
08: private boolean initiallyDeferred = false;
09: private boolean deferrable = false;
10:
11: public ForeignKeyConstraint(String foreignKeyName, String references) {
12: this .foreignKeyName = foreignKeyName;
13: this .references = references;
14: }
15:
16: public String getForeignKeyName() {
17: return foreignKeyName;
18: }
19:
20: public String getColumn() {
21: return column;
22: }
23:
24: public ForeignKeyConstraint setColumn(String column) {
25: this .column = column;
26: return this ;
27: }
28:
29: public String getReferences() {
30: return references;
31: }
32:
33: public boolean isDeleteCascade() {
34: return deleteCascade;
35: }
36:
37: public ForeignKeyConstraint setDeleteCascade(boolean deleteCascade) {
38: this .deleteCascade = deleteCascade;
39: return this ;
40: }
41:
42: public boolean isInitiallyDeferred() {
43: return initiallyDeferred;
44: }
45:
46: public ForeignKeyConstraint setInitiallyDeferred(
47: boolean initiallyDeferred) {
48: this .initiallyDeferred = initiallyDeferred;
49: return this ;
50: }
51:
52: public boolean isDeferrable() {
53: return deferrable;
54: }
55:
56: public ForeignKeyConstraint setDeferrable(boolean deferrable) {
57: this.deferrable = deferrable;
58: return this;
59: }
60: }
|