public class ForeignKey extends AbstractConstraint implements Constraint, Exportable
Modifier and Type | Class and Description |
---|---|
static class |
ForeignKey.ReferentialAction |
Modifier | Constructor and Description |
---|---|
protected |
ForeignKey(TableSpecification sourceTable,
TableSpecification targetTable) |
protected |
ForeignKey(TableSpecification sourceTable,
TableSpecification targetTable,
String name) |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(Column column) |
void |
addColumnMapping(Column sourceColumn,
Column targetColumn) |
ForeignKey.ReferentialAction |
getDeleteRule() |
String |
getExportIdentifier()
Get a unique identifier to make sure we are not exporting the same database structure multiple times.
|
Iterable<Column> |
getSourceColumns() |
TableSpecification |
getSourceTable() |
Iterable<Column> |
getTargetColumns() |
TableSpecification |
getTargetTable() |
ForeignKey.ReferentialAction |
getUpdateRule() |
void |
setDeleteRule(ForeignKey.ReferentialAction deleteRule) |
void |
setUpdateRule(ForeignKey.ReferentialAction updateRule) |
String |
sqlConstraintStringInAlterTable(Dialect dialect) |
String[] |
sqlDropStrings(Dialect dialect)
Gets the SQL strings for dropping the database object.
|
getColumns, getColumnSpan, getName, getTable, internalAddColumn, internalColumnAccess, isCreationVetoed, sqlCreateStrings
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getColumns, getName, getTable
sqlCreateStrings
protected ForeignKey(TableSpecification sourceTable, TableSpecification targetTable, String name)
protected ForeignKey(TableSpecification sourceTable, TableSpecification targetTable)
public TableSpecification getSourceTable()
public TableSpecification getTargetTable()
public void addColumn(Column column)
addColumn
in class AbstractConstraint
public String getExportIdentifier()
Exportable
getExportIdentifier
in interface Exportable
public ForeignKey.ReferentialAction getDeleteRule()
public void setDeleteRule(ForeignKey.ReferentialAction deleteRule)
public ForeignKey.ReferentialAction getUpdateRule()
public void setUpdateRule(ForeignKey.ReferentialAction updateRule)
public String[] sqlDropStrings(Dialect dialect)
Exportable
sqlDropStrings
in interface Exportable
sqlDropStrings
in class AbstractConstraint
dialect
- The dialect for which to generate the SQL drop stringspublic String sqlConstraintStringInAlterTable(Dialect dialect)
sqlConstraintStringInAlterTable
in class AbstractConstraint
Copyright © 2018 JBoss by Red Hat. All rights reserved.