public class ForeignKey extends Constraint
Constructor and Description |
---|
ForeignKey() |
Modifier and Type | Method and Description |
---|---|
void |
addReferencedColumns(Iterator referencedColumnsIterator) |
void |
alignColumns()
Validates that columnspan of the foreignkey and the primarykey is the same.
|
void |
disableCreation() |
String |
generatedConstraintNamePrefix() |
String |
getExportIdentifier()
Get a unique identifier to make sure we are not exporting the same database structure multiple times.
|
List |
getReferencedColumns()
Returns the referenced columns if the foreignkey does not refer to the primary key
|
String |
getReferencedEntityName() |
Table |
getReferencedTable() |
boolean |
isCascadeDeleteEnabled() |
boolean |
isCreationEnabled() |
boolean |
isPhysicalConstraint() |
boolean |
isReferenceToPrimaryKey()
Does this foreignkey reference the primary key of the reference table
|
void |
setCascadeDeleteEnabled(boolean cascadeDeleteEnabled) |
void |
setName(String name) |
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() |
addColumn, addColumns, columnIterator, containsColumn, generateName, generateName, getColumn, getColumnIterator, getColumns, getColumnSpan, getName, getTable, hashedName, isGenerated, setTable, sqlCreateString
public String getExportIdentifier()
Exportable
public void disableCreation()
public boolean isCreationEnabled()
public void setName(String name)
setName
in class Constraint
public String sqlConstraintString(Dialect dialect, String constraintName, String defaultCatalog, String defaultSchema)
sqlConstraintString
in class Constraint
public Table getReferencedTable()
public void setReferencedTable(Table referencedTable) throws MappingException
MappingException
public void alignColumns()
public String getReferencedEntityName()
public void setReferencedEntityName(String referencedEntityName)
public String sqlDropString(Dialect dialect, String defaultCatalog, String defaultSchema)
sqlDropString
in interface RelationalModel
sqlDropString
in class Constraint
public boolean isCascadeDeleteEnabled()
public void setCascadeDeleteEnabled(boolean cascadeDeleteEnabled)
public boolean isPhysicalConstraint()
public List getReferencedColumns()
public boolean isReferenceToPrimaryKey()
public void addReferencedColumns(Iterator referencedColumnsIterator)
public String toString()
toString
in class Constraint
public String generatedConstraintNamePrefix()
generatedConstraintNamePrefix
in class Constraint
Copyright © 2001-2017 Red Hat, Inc. All Rights Reserved.