public class ForeignKeyImpl extends ColumnSetImpl implements ForeignKey
Implementation of a foreign key.
Modifier and Type | Class and Description |
---|---|
static class |
ForeignKeyImpl.ColumnReferenceImpl |
ForeignKey.ColumnLink, ForeignKey.Mode
Modifier and Type | Field and Description |
---|---|
java.util.List |
references |
Modifier | Constructor and Description |
---|---|
protected |
ForeignKeyImpl(Table pTable,
Table pReferencedTable) |
Modifier and Type | Method and Description |
---|---|
void |
addColumnLink(Column.Name pName,
Column.Name pReferencedName)
Adds a reference between the given columns.
|
void |
addColumnLink(Column pColumn,
Column pReferencedColumn)
Adds a reference between the given columns.
|
void |
addColumnLink(java.lang.String pName,
java.lang.String pReferencedName)
Adds a reference between the given columns.
|
void |
addColumnReference(ForeignKey.ColumnLink pReference) |
java.util.Iterator |
getColumnLinks()
Returns all column references in the foreign key.
|
java.util.Iterator |
getColumns()
Returns the column sets columns.
|
ForeignKey.Mode |
getOnDelete()
Returns the OnDelete mode.
|
ForeignKey.Mode |
getOnUpdate()
Returns the OnUpdate mode.
|
ColumnSet |
getReferencedColumns()
Returns the set of referenced columns.
|
Table |
getReferencedTable()
Returns the referenced table.
|
void |
setOnDelete(ForeignKey.Mode pMode)
Sets the OnDelete mode.
|
void |
setOnUpdate(ForeignKey.Mode pMode)
Sets the OnUpdate mode.
|
getTable
public Table getReferencedTable()
ForeignKey
Returns the referenced table.
getReferencedTable
in interface ForeignKey
public void setOnDelete(ForeignKey.Mode pMode)
ForeignKey
Sets the OnDelete mode.
setOnDelete
in interface ForeignKey
public ForeignKey.Mode getOnDelete()
ForeignKey
Returns the OnDelete mode.
getOnDelete
in interface ForeignKey
public void setOnUpdate(ForeignKey.Mode pMode)
ForeignKey
Sets the OnUpdate mode.
setOnUpdate
in interface ForeignKey
public ForeignKey.Mode getOnUpdate()
ForeignKey
Returns the OnUpdate mode.
getOnUpdate
in interface ForeignKey
public void addColumnLink(Column pColumn, Column pReferencedColumn)
ForeignKey
Adds a reference between the given columns.
addColumnLink
in interface ForeignKey
pColumn
- A column of the table, on which the foreign key is
definedpReferencedColumn
- A column of the referenced tablepublic void addColumnReference(ForeignKey.ColumnLink pReference)
public void addColumnLink(Column.Name pName, Column.Name pReferencedName)
ForeignKey
Adds a reference between the given columns.
addColumnLink
in interface ForeignKey
pName
- Column name of the table, on which the foreign
key is definedpReferencedName
- Column name of the referenced table.public void addColumnLink(java.lang.String pName, java.lang.String pReferencedName)
ForeignKey
Adds a reference between the given columns.
addColumnLink
in interface ForeignKey
pName
- Column name of the table, on which the foreign
key is definedpReferencedName
- Column name of the referenced table.public java.util.Iterator getColumnLinks()
ForeignKey
Returns all column references in the foreign key. Any instance
returned by the Iterator
is an instance of
ForeignKey.ColumnLink
.
getColumnLinks
in interface ForeignKey
public java.util.Iterator getColumns()
ColumnSet
Returns the column sets columns. In the case of an Index
,
these are the columns that have been added via Index.addColumn(Column)
.
In the case of a ForeignKey
, these are the local columns of
column links.
getColumns
in interface ColumnSet
public ColumnSet getReferencedColumns()
ForeignKey
Returns the set of referenced columns.
getReferencedColumns
in interface ForeignKey