Top Description Fields Constructors Methods
org.hibernate.mapping

public Class ForeignKey

extends Constraint
Class Inheritance
Imports
java.util.ArrayList, .Iterator, .List, org.hibernate.MappingException, org.hibernate.dialect.Dialect

A foreign key constraint
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private boolean
private List<E>
private String
private Table

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public void
addReferencedColumns(Iterator<E> referencedColumnsIterator)

public void
alignColumns()

Validates that columnspan of the foreignkey and the primarykey is the same.

private void
alignColumns(Table referencedTable)

private void
public List<E>
getReferencedColumns()

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

public String
public Table
public boolean
public boolean
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)

Implements abstract org.hibernate.mapping.Constraint.sqlConstraintString.

public String
public String
toString()

Overrides org.hibernate.mapping.Constraint.toString.

Returns a string representation of the object.
Inherited from org.hibernate.mapping.Constraint:
addColumnaddColumnscolumnIteratorcontainsColumngetColumngetColumnIteratorgetColumnsgetColumnSpangetNamegetTableisGeneratedsetNamesetTablesqlCreateString

Field Detail

cascadeDeleteEnabledback to summary
private boolean cascadeDeleteEnabled
referencedColumnsback to summary
private List<E> referencedColumns
referencedEntityNameback to summary
private String referencedEntityName
referencedTableback to summary
private Table referencedTable

Constructor Detail

ForeignKeyback to summary
public ForeignKey()

Method Detail

addReferencedColumnback to summary
private void addReferencedColumn(Column column)
addReferencedColumnsback to summary
public void addReferencedColumns(Iterator<E> referencedColumnsIterator)
alignColumnsback to summary
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.

alignColumnsback to summary
private void alignColumns(Table referencedTable)
appendColumnsback to summary
private void appendColumns(StringBuffer buf, Iterator<E> columns)
getReferencedColumnsback to summary
public List<E> getReferencedColumns()

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

getReferencedEntityNameback to summary
public String getReferencedEntityName()
getReferencedTableback to summary
public Table getReferencedTable()
isCascadeDeleteEnabledback to summary
public boolean isCascadeDeleteEnabled()
isPhysicalConstraintback to summary
public boolean isPhysicalConstraint()
isReferenceToPrimaryKeyback to summary
public boolean isReferenceToPrimaryKey()

Does this foreignkey reference the primary key of the reference table

setCascadeDeleteEnabledback to summary
public void setCascadeDeleteEnabled(boolean cascadeDeleteEnabled)
setReferencedEntityNameback to summary
public void setReferencedEntityName(String referencedEntityName)
setReferencedTableback to summary
public void setReferencedTable(Table referencedTable) throws MappingException
sqlConstraintStringback to summary
public String sqlConstraintString(Dialect dialect, String constraintName, String defaultCatalog, String defaultSchema)

Implements abstract org.hibernate.mapping.Constraint.sqlConstraintString.

sqlDropStringback to summary
public String sqlDropString(Dialect dialect, String defaultCatalog, String defaultSchema)

Overrides org.hibernate.mapping.Constraint.sqlDropString.

Implements org.hibernate.mapping.RelationalModel.sqlDropString.

toStringback to summary
public String toString()

Overrides org.hibernate.mapping.Constraint.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.