Package org.hibernate.mapping
Class ForeignKey
java.lang.Object
org.hibernate.mapping.Constraint
org.hibernate.mapping.ForeignKey
- All Implemented Interfaces:
Serializable,Exportable
A mapping model object representing a foreign key constraint.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReferencedColumns(List<Column> referencedColumns) voidValidates that column span of the foreign key and the primary key is the same.voidGet a unique identifier to make sure we are not exporting the same database structure multiple times.Returns the referenced columns if the foreignkey does not refer to the primary keybooleanbooleanbooleanDoes this foreignkey reference the primary key of the reference tableresolveReferencedClass(Metadata metadata) voidsetKeyDefinition(String keyDefinition) voidvoidsetOnDeleteAction(OnDeleteAction onDeleteAction) voidsetReferencedEntityName(String referencedEntityName) voidsetReferencedTable(Table referencedTable) toString()Methods inherited from class org.hibernate.mapping.Constraint
addColumn, addColumns, containsColumn, getColumn, getColumns, getColumnSpan, getName, getOptions, getTable, setOptions, setTable
-
Constructor Details
-
ForeignKey
-
ForeignKey
Deprecated.
-
-
Method Details
-
getExportIdentifier
Description copied from interface:ExportableGet a unique identifier to make sure we are not exporting the same database structure multiple times.- Returns:
- The exporting identifier.
-
disableCreation
public void disableCreation() -
isCreationEnabled
public boolean isCreationEnabled() -
setName
- Overrides:
setNamein classConstraint
-
getReferencedTable
-
setReferencedTable
- Throws:
MappingException
-
alignColumns
public void alignColumns()Validates that column span of the foreign key and the primary key is the same.Furthermore it aligns the length of the underlying tables columns.
-
getReferencedEntityName
-
setReferencedEntityName
-
getKeyDefinition
-
setKeyDefinition
-
setOnDeleteAction
-
getOnDeleteAction
-
isPhysicalConstraint
public boolean isPhysicalConstraint() -
getReferencedColumns
Returns the referenced columns if the foreignkey does not refer to the primary key -
isReferenceToPrimaryKey
public boolean isReferenceToPrimaryKey()Does this foreignkey reference the primary key of the reference table -
addReferencedColumns
-
toString
- Overrides:
toStringin classConstraint
-
resolveReferencedClass
-