Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
public class ForeignKeyIndex extends NamedConstraint {
private Table table;
private List<String> referencedColumnNames;
private String onDeleteReferenceOption;
private String onUpdateReferenceOption;

public Table getTable() {
return table;
Expand All @@ -49,9 +51,33 @@ public void setReferencedColumnNames(List<String> referencedColumnNames) {
this.referencedColumnNames = referencedColumnNames;
}

public String getOnDeleteReferenceOption() {
return onDeleteReferenceOption;
}

public void setOnDeleteReferenceOption(String onDeleteReferenceOption) {
this.onDeleteReferenceOption = onDeleteReferenceOption;
}

public String getOnUpdateReferenceOption() {
return onUpdateReferenceOption;
}

public void setOnUpdateReferenceOption(String onUpdateReferenceOption) {
this.onUpdateReferenceOption = onUpdateReferenceOption;
}

@Override
public String toString() {
String referenceOptions = "";
if(onDeleteReferenceOption != null) {
referenceOptions += " ON DELETE " + onDeleteReferenceOption;
}
if(onUpdateReferenceOption != null) {
referenceOptions += " ON UPDATE " + onUpdateReferenceOption;
}
return super.toString()
+ " REFERENCES " + table + PlainSelect.getStringList(getReferencedColumnNames(), true, true);
+ " REFERENCES " + table + PlainSelect.getStringList(getReferencedColumnNames(), true, true)
+ referenceOptions;
}
}
Loading