public final class ForeignKey extends Object
Constructor and Description |
---|
ForeignKey(BasicTable parentTable,
BasicTable referencedTable,
String[] columnNames) |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes the foreign key.
|
boolean |
equals(Object obj) |
Map<String,Column<?>> |
getColumns()
Unmodified list of columns for the foreign key.
|
String |
getConstraintName()
Returns the name of FK constraint (or generates it if it's not provided).
|
FKRule |
getDeleteRule()
Returns rule for deletion.
|
BasicTable |
getParentTable()
Table that the foreign key is part of.
|
BasicTable |
getReferencedTable()
Table that is being referenced by the foreign key.
|
FKRule |
getUpdateRule()
Returns rule for update.
|
int |
hashCode() |
void |
setConstraintName(String constraintName)
Sets name for FK constraint.
|
void |
setDeleteRule(FKRule deleteBehaviour)
Sets rule for deletion.
|
void |
setUpdateRule(FKRule updateBehaviour)
Sets rule for update.
|
public ForeignKey(BasicTable parentTable, BasicTable referencedTable, String[] columnNames) throws ParseException
ParseException
public void setDeleteRule(FKRule deleteBehaviour) throws ParseException
deleteBehaviour
- rule for deletion.ParseException
- When trying to modify the system grain.public void setUpdateRule(FKRule updateBehaviour) throws ParseException
updateBehaviour
- rule for update.ParseException
- When trying to modify the system grain.public Map<String,Column<?>> getColumns()
public BasicTable getParentTable()
public BasicTable getReferencedTable()
public FKRule getDeleteRule()
public FKRule getUpdateRule()
public String getConstraintName()
public void setConstraintName(String constraintName) throws ParseException
constraintName
- new name of constraintParseException
- incorrect name of constraintpublic void delete() throws ParseException
ParseException
- When trying to modify the system grain.Copyright © 2023 CURS. All rights reserved.