public class

ForeignKey

extends Constraint
java.lang.Object
   ↳ org.hibernate.mapping.Constraint
     ↳ org.hibernate.mapping.ForeignKey

Class Overview

A foreign key constraint

Summary

Public Constructors
ForeignKey()
Public Methods
void addReferencedColumns(Iterator referencedColumnsIterator)
void alignColumns()
Validates that columnspan of the foreignkey and the primarykey is the same.
List getReferencedColumns()
Returns the referenced columns if the foreignkey does not refer to the primary key
String getReferencedEntityName()
Table getReferencedTable()
boolean isCascadeDeleteEnabled()
boolean isPhysicalConstraint()
boolean isReferenceToPrimaryKey()
Does this foreignkey reference the primary key of the reference table
void setCascadeDeleteEnabled(boolean cascadeDeleteEnabled)
void setReferencedEntityName(String referencedEntityName)
void setReferencedTable(Table referencedTable)
String sqlConstraintString(Dialect dialect, String constraintName, String defaultCatalog, String defaultSchema)
String sqlDropString(Dialect dialect, String defaultCatalog, String defaultSchema)
String toString()
[Expand]
Inherited Methods
From class org.hibernate.mapping.Constraint
From class java.lang.Object
From interface org.hibernate.mapping.RelationalModel

Public Constructors

public ForeignKey ()

Public Methods

public void addReferencedColumns (Iterator referencedColumnsIterator)

public void alignColumns ()

Validates that columnspan of the foreignkey and the primarykey is the same. Furthermore it aligns the length of the underlying tables columns.

public List getReferencedColumns ()

Returns the referenced columns if the foreignkey does not refer to the primary key

public String getReferencedEntityName ()

public Table getReferencedTable ()

public boolean isCascadeDeleteEnabled ()

public boolean isPhysicalConstraint ()

public boolean isReferenceToPrimaryKey ()

Does this foreignkey reference the primary key of the reference table

public void setCascadeDeleteEnabled (boolean cascadeDeleteEnabled)

public void setReferencedEntityName (String referencedEntityName)

public void setReferencedTable (Table referencedTable)

public String sqlConstraintString (Dialect dialect, String constraintName, String defaultCatalog, String defaultSchema)

public String sqlDropString (Dialect dialect, String defaultCatalog, String defaultSchema)

public String toString ()