|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A ForeignKey models a foreign key relationship between two Columnsets. One of the Columnsets has a foreign key that refers to the primary key of the other Columnset. So each ForeignKey has a PrimaryKeyColumnset and a ForeignKeyColumnset. In both Columnsets, several Columns may be involved in the key; in this case, the ForeignKey maps each Column of the key of the PrimaryKeyColumnset to the corresponding Column of the key of the ForeignKeyColumnset. A 1:n Relation has one ForeignKey to model its links on the relational level. An n:m Relation uses TWO ForeignKeys, to model the relationship between the Columnset of the FromConcept and the cross table on the one hand, and the relationship between the Columnset of the ToConcept and the cross table on the other hand.
Method Summary | |
void |
addColumnLink(Column fkColumn,
Column pkColumn)
Adds a Column Link to this ForeignKey. |
ForeignKey |
copy(Columnset newColumnSet)
|
java.util.Collection |
getAllColumnLinks()
This method returns a Collection of ForeignKeyLink s.
|
ForeignKeyLink |
getFirstColumnLink()
Convenience method used by classes that assume that each ForeignKey link involves only one Column in each of the two Columnsets. |
Column |
getForeignForPrimaryColumn(Column thePrimaryKeyColumn)
Returns the foreign key column that is associated with the given primary key column, if the latter exists in this ForeignKey. |
Columnset |
getForeignKeyColumnset()
Getter method. |
Column |
getPrimaryForForeignColumn(Column theForeignKeyColumn)
Returns the primary key column that is associated with the given foreign key column, if the latter exists in this ForeignKey. |
Columnset |
getPrimaryKeyColumnset()
Getter method. |
Relation |
getRelation()
Getter method. |
boolean |
isColumnContainedInForeignColumns(Column theColumn)
Returns TRUE iff the given Column acts as a foreign key Column in this ForeignKey. |
boolean |
isColumnContainedInPrimaryColumns(Column theColumn)
Returns TRUE iff the given Column acts as a primary key Column in this ForeignKey. |
void |
removeAllColumnLinks()
Empties this ForeignKey of all Column Links. |
void |
removeColumnLink(java.lang.String foreignKeyColumnName)
Removes a Column Link from this ForeignKey. |
void |
removeForeignKeyColumnset()
|
void |
removePrimaryKeyColumnset()
|
void |
setForeignKeyColumnset(Columnset cs)
Setter method. |
void |
setPrimaryKeyColumnset(Columnset cs)
Setter method. |
void |
setRelation(Relation rel,
boolean isFrom)
Setter method. |
Methods inherited from interface edu.udo.cs.miningmart.m4.M4Data |
deleteSoon, getDocumentation, getValidName, isDirty, isWaitingForDelete, setDocumentation |
Methods inherited from interface edu.udo.cs.miningmart.m4.M4Object |
doPrint, doPrint, equals, executeBusinessSingleValueSqlRead, executeBusinessSingleValueSqlReadL, executeBusinessSqlRead, executeBusinessSqlWrite, executeM4SingleValueSqlRead, executeM4SingleValueSqlReadL, executeM4SqlRead, executeM4SqlWrite, getCasePrintObject, getId, getM4Db, getM4ObjectFromCache, getName, getNextM4SequenceValue, isNew, load, print, putM4ObjectToCache, replaceSpacesInName, setId, setName |
Method Detail |
public Relation getRelation() throws M4Exception
M4Exception
public void setRelation(Relation rel, boolean isFrom) throws M4Exception
rel
- The Relation this ForeignKey is to be associated withisFrom
- TRUE iff this ForeignKey is the fromKey of that Relation,
FALSE if it is the toKey. (An n:m Relation needs both a fromKey
and a toKey. A 1:n Relation needs only a fromKey.)
M4Exception
public void addColumnLink(Column fkColumn, Column pkColumn) throws M4Exception
fkColumn
- The foreign key Column to add to this ForeignKey.pkColumn
- The primary key Column that is referenced by fkColumn.
M4Exception
public void removeColumnLink(java.lang.String foreignKeyColumnName) throws M4Exception
M4Exception
public void removeAllColumnLinks() throws M4Exception
M4Exception
public boolean isColumnContainedInForeignColumns(Column theColumn) throws M4Exception
theColumn
- the given Column
M4Exception
public boolean isColumnContainedInPrimaryColumns(Column theColumn) throws M4Exception
theColumn
- the given Column
M4Exception
public Column getPrimaryForForeignColumn(Column theForeignKeyColumn) throws M4Exception
theForeignKeyColumn
- the given foreign key column
M4Exception
public Column getForeignForPrimaryColumn(Column thePrimaryKeyColumn) throws M4Exception
thePrimaryKeyColumn
- the given primary key column
M4Exception
public Columnset getPrimaryKeyColumnset() throws M4Exception
getPrimaryKeyColumnset
in interface Key
M4Exception
public void setPrimaryKeyColumnset(Columnset cs) throws M4Exception
setPrimaryKeyColumnset
in interface Key
cs
- The new columnset of the primary key of this ForeignKey
M4Exception
public Columnset getForeignKeyColumnset() throws M4Exception
getForeignKeyColumnset
in interface Key
M4Exception
public void setForeignKeyColumnset(Columnset cs) throws M4Exception
setForeignKeyColumnset
in interface Key
cs
- The new columnset of the foreign key of this ForeignKey
M4Exception
public java.util.Collection getAllColumnLinks() throws M4Exception
Collection
of ForeignKeyLink
s.
Each ForeignKeyLink
links one Column of the foreign Columnset
to the corresponding Column of the primary Columnset.
Collection
of ForeignKeyLink
s
M4Exception
public ForeignKeyLink getFirstColumnLink() throws M4Exception
M4Exception
public void removeForeignKeyColumnset() throws M4Exception
M4Exception
public void removePrimaryKeyColumnset() throws M4Exception
M4Exception
public ForeignKey copy(Columnset newColumnSet) throws M4Exception
M4Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |