org.hibernate.mapping
Class ForeignKey
java.lang.Object
   org.hibernate.mapping.Constraint
org.hibernate.mapping.Constraint
       org.hibernate.mapping.ForeignKey
org.hibernate.mapping.ForeignKey
- All Implemented Interfaces: 
- Serializable, RelationalModel
- public class ForeignKey 
- extends Constraint
A foreign key constraint
- See Also:
- Serialized Form
 
 
| Methods inherited from class org.hibernate.mapping.Constraint | 
| addColumn, addColumns, columnIterator, containsColumn, getColumn, getColumnIterator, getColumns, getColumnSpan, getName, getTable, isGenerated, setName, setTable, sqlCreateString | 
 
 
ForeignKey
public ForeignKey()
sqlConstraintString
public String sqlConstraintString(Dialect dialect,
                                  String constraintName,
                                  String defaultCatalog,
                                  String defaultSchema)
- 
- Specified by:
- sqlConstraintStringin class- Constraint
 
- 
 
getReferencedTable
public Table getReferencedTable()
- 
 
setReferencedTable
public void setReferencedTable(Table referencedTable)
                        throws MappingException
- 
- Throws:
- MappingException
 
alignColumns
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.
 
- 
 
getReferencedEntityName
public String getReferencedEntityName()
- 
 
setReferencedEntityName
public void setReferencedEntityName(String referencedEntityName)
- 
 
sqlDropString
public String sqlDropString(Dialect dialect,
                            String defaultCatalog,
                            String defaultSchema)
- 
- Specified by:
- sqlDropStringin interface- RelationalModel
- Overrides:
- sqlDropStringin class- Constraint
 
- 
 
isCascadeDeleteEnabled
public boolean isCascadeDeleteEnabled()
- 
 
setCascadeDeleteEnabled
public void setCascadeDeleteEnabled(boolean cascadeDeleteEnabled)
- 
 
isPhysicalConstraint
public boolean isPhysicalConstraint()
- 
 
getReferencedColumns
public List 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
public void addReferencedColumns(Iterator referencedColumnsIterator)
- 
 
toString
public String toString()
- 
- Overrides:
- toStringin class- Constraint
 
- 
 
Copyright © 2001-2012 Red Hat, Inc.  All Rights Reserved.