Package ru.curs.celesta.score
Class ForeignKey
java.lang.Object
ru.curs.celesta.score.ForeignKey
Foreign key class.
-
Constructor Summary
ConstructorsConstructorDescriptionForeignKey(BasicTable parentTable, BasicTable referencedTable, String[] columnNames) -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Deletes the foreign key.booleanUnmodified list of columns for the foreign key.Returns the name of FK constraint (or generates it if it's not provided).Returns rule for deletion.Table that the foreign key is part of.Table that is being referenced by the foreign key.Returns rule for update.inthashCode()voidsetConstraintName(String constraintName) Sets name for FK constraint.voidsetDeleteRule(FKRule deleteBehaviour) Sets rule for deletion.voidsetUpdateRule(FKRule updateBehaviour) Sets rule for update.
-
Constructor Details
-
ForeignKey
public ForeignKey(BasicTable parentTable, BasicTable referencedTable, String[] columnNames) throws ParseException - Throws:
ParseException
-
-
Method Details
-
setDeleteRule
Sets rule for deletion.- Parameters:
deleteBehaviour- rule for deletion.- Throws:
ParseException- When trying to modify the system grain.
-
setUpdateRule
Sets rule for update.- Parameters:
updateBehaviour- rule for update.- Throws:
ParseException- When trying to modify the system grain.
-
getColumns
Unmodified list of columns for the foreign key.- Returns:
-
getParentTable
Table that the foreign key is part of.- Returns:
-
getReferencedTable
Table that is being referenced by the foreign key.- Returns:
-
getDeleteRule
Returns rule for deletion.- Returns:
-
getUpdateRule
Returns rule for update.- Returns:
-
hashCode
public int hashCode() -
equals
-
getConstraintName
Returns the name of FK constraint (or generates it if it's not provided).- Returns:
-
setConstraintName
Sets name for FK constraint.- Parameters:
constraintName- new name of constraint- Throws:
ParseException- incorrect name of constraint
-
delete
Deletes the foreign key.- Throws:
ParseException- When trying to modify the system grain.
-