Interface DB2LUWForeignKey
public interface DB2LUWForeignKey
Defines a foreign key relationship between two tables.
Unlike PostgreSQL and Microsoft SQL Server, Db2 for Linux, UNIX and Windows foreign key constraints have no "ON UPDATE" clause at all (like Oracle, Db2 expects primary keys to be immutable), so there is no isUpdateCascade() property to set here.
Unlike PostgreSQL and Microsoft SQL Server, Db2 for Linux, UNIX and Windows foreign key constraints have no "ON UPDATE" clause at all (like Oracle, Db2 expects primary keys to be immutable), so there is no isUpdateCascade() property to set here.
-
Method Summary
Modifier and TypeMethodDescriptionReturn the name of the constraint.Return the column in the table that is the foreign key.Return the primary key column in the reference table.Return details of the table where the primary key is located.booleanIf the row with the primary key is deleted, should the rows with the foreign key also be deleted?
-
Method Details
-
getConstraintName
String getConstraintName()Return the name of the constraint.- Returns:
- name
-
getForeignKeyColumn
DB2LUWColumn getForeignKeyColumn()Return the column in the table that is the foreign key.- Returns:
- column
-
getReferenceTable
DB2LUWTable getReferenceTable()Return details of the table where the primary key is located.- Returns:
- table
-
getReferenceColumn
DB2LUWColumn getReferenceColumn()Return the primary key column in the reference table.- Returns:
- column
-
isDeleteCascade
boolean isDeleteCascade()If the row with the primary key is deleted, should the rows with the foreign key also be deleted?- Returns:
- boolean
-