net.sf.jaxme.sqls
Interface ForeignKey

All Superinterfaces:
ColumnSet
All Known Implementing Classes:
ForeignKeyImpl

public interface ForeignKey
extends ColumnSet

Interface of a foreign key.

Author:
Jochen Wiedmann

Nested Class Summary
static interface ForeignKey.ColumnLink
           
static class ForeignKey.Mode
           
 
Method Summary
 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.
 java.util.Iterator getColumnLinks()
          Returns all column references in the foreign key.
 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.
 
Methods inherited from interface net.sf.jaxme.sqls.ColumnSet
getColumns, getTable
 

Method Detail

getReferencedTable

public Table getReferencedTable()

Returns the referenced table.


setOnDelete

public void setOnDelete(ForeignKey.Mode pMode)

Sets the OnDelete mode.


getOnDelete

public ForeignKey.Mode getOnDelete()

Returns the OnDelete mode.


setOnUpdate

public void setOnUpdate(ForeignKey.Mode pMode)

Sets the OnUpdate mode.


getOnUpdate

public ForeignKey.Mode getOnUpdate()

Returns the OnUpdate mode.


addColumnLink

public void addColumnLink(Column pColumn,
                          Column pReferencedColumn)

Adds a reference between the given columns.

Parameters:
pColumn - A column of the table, on which the foreign key is defined
pReferencedColumn - A column of the referenced table

addColumnLink

public void addColumnLink(Column.Name pName,
                          Column.Name pReferencedName)

Adds a reference between the given columns.

Parameters:
pName - Column name of the table, on which the foreign key is defined
pReferencedName - Column name of the referenced table.

addColumnLink

public void addColumnLink(java.lang.String pName,
                          java.lang.String pReferencedName)

Adds a reference between the given columns.

Parameters:
pName - Column name of the table, on which the foreign key is defined
pReferencedName - Column name of the referenced table.

getColumnLinks

public java.util.Iterator getColumnLinks()

Returns all column references in the foreign key. Any instance returned by the Iterator is an instance of ForeignKey.ColumnLink.


getReferencedColumns

public ColumnSet getReferencedColumns()

Returns the set of referenced columns.