Package org.apache.torque.map
Class ForeignKeyMap
java.lang.Object
org.apache.torque.map.ForeignKeyMap
- All Implemented Interfaces:
Serializable
ForeignKeyMap is used to model a foreign key in a database.
- Version:
- $Id: ForeignKeyMap.java 1839288 2018-08-27 09:48:33Z tv $
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA pair of local and Foreign column. -
Constructor Summary
ConstructorsConstructorDescriptionForeignKeyMap(TableMap table, String foreignTableName) Constructor.ForeignKeyMap(TableMap table, TableMap foreignTable) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumns(ForeignKeyMap.ColumnPair columnPair) Adds a column pair to the foreign key.Returns the column pairs.Returns the foreign table of the foreign key.Returns name of the foreign table of the foreign key.getTable()Returns the local table of the foreign key.
-
Constructor Details
-
ForeignKeyMap
Constructor.- Parameters:
table- the local table, not null.foreignTable- the foreign table, not null.- Throws:
NullPointerException- if an argument is null.
-
ForeignKeyMap
Constructor.- Parameters:
table- the local table, not null.foreignTableName- the name of the foreign table, not null.- Throws:
NullPointerException- if an argument is null.
-
-
Method Details
-
addColumns
Adds a column pair to the foreign key.- Parameters:
columnPair- the column pair to add, not null.
-
getTable
Returns the local table of the foreign key.- Returns:
- the referencing table, not null.
-
getForeignTable
Returns the foreign table of the foreign key.- Returns:
- the referenced table, not null.
- Throws:
IllegalStateException- if the foreign table map builder was not yet built.
-
getForeignTableName
Returns name of the foreign table of the foreign key.- Returns:
- the name of the referenced table, not null.
-
getColumns
Returns the column pairs.- Returns:
- the column pairs, not null, as unmodifiable list.
-