org.apache.ws.jaxme.sqls.impl
Class ForeignKeyImpl

java.lang.Object
  extended by org.apache.ws.jaxme.sqls.impl.ColumnSetImpl
      extended by org.apache.ws.jaxme.sqls.impl.ForeignKeyImpl
All Implemented Interfaces:
ColumnSet, ForeignKey

public class ForeignKeyImpl
extends ColumnSetImpl
implements ForeignKey

Implementation of a foreign key.

Author:
Jochen Wiedmann

Nested Class Summary
static class ForeignKeyImpl.ColumnReferenceImpl
           
 
Nested classes/interfaces inherited from interface org.apache.ws.jaxme.sqls.ForeignKey
ForeignKey.ColumnLink, ForeignKey.Mode
 
Field Summary
 java.util.List references
           
 
Constructor Summary
protected ForeignKeyImpl(Table pTable, Table pReferencedTable)
           
 
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.
 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.
 
Methods inherited from class org.apache.ws.jaxme.sqls.impl.ColumnSetImpl
getTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.ws.jaxme.sqls.ColumnSet
getTable
 

Field Detail

references

public java.util.List references
Constructor Detail

ForeignKeyImpl

protected ForeignKeyImpl(Table pTable,
                         Table pReferencedTable)
Method Detail

getReferencedTable

public Table getReferencedTable()
Description copied from interface: ForeignKey

Returns the referenced table.

Specified by:
getReferencedTable in interface ForeignKey

setOnDelete

public void setOnDelete(ForeignKey.Mode pMode)
Description copied from interface: ForeignKey

Sets the OnDelete mode.

Specified by:
setOnDelete in interface ForeignKey

getOnDelete

public ForeignKey.Mode getOnDelete()
Description copied from interface: ForeignKey

Returns the OnDelete mode.

Specified by:
getOnDelete in interface ForeignKey

setOnUpdate

public void setOnUpdate(ForeignKey.Mode pMode)
Description copied from interface: ForeignKey

Sets the OnUpdate mode.

Specified by:
setOnUpdate in interface ForeignKey

getOnUpdate

public ForeignKey.Mode getOnUpdate()
Description copied from interface: ForeignKey

Returns the OnUpdate mode.

Specified by:
getOnUpdate in interface ForeignKey

addColumnLink

public void addColumnLink(Column pColumn,
                          Column pReferencedColumn)
Description copied from interface: ForeignKey

Adds a reference between the given columns.

Specified by:
addColumnLink in interface ForeignKey
Parameters:
pColumn - A column of the table, on which the foreign key is defined
pReferencedColumn - A column of the referenced table

addColumnReference

public void addColumnReference(ForeignKey.ColumnLink pReference)

addColumnLink

public void addColumnLink(Column.Name pName,
                          Column.Name pReferencedName)
Description copied from interface: ForeignKey

Adds a reference between the given columns.

Specified by:
addColumnLink in interface ForeignKey
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)
Description copied from interface: ForeignKey

Adds a reference between the given columns.

Specified by:
addColumnLink in interface ForeignKey
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()
Description copied from interface: ForeignKey

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

Specified by:
getColumnLinks in interface ForeignKey

getColumns

public java.util.Iterator getColumns()
Description copied from interface: 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.

Specified by:
getColumns in interface ColumnSet

getReferencedColumns

public ColumnSet getReferencedColumns()
Description copied from interface: ForeignKey

Returns the set of referenced columns.

Specified by:
getReferencedColumns in interface ForeignKey