|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.udo.cs.miningmart.m4.core.M4Object
edu.udo.cs.miningmart.m4.core.M4Data
edu.udo.cs.miningmart.m4.core.Key
edu.udo.cs.miningmart.m4.core.ForeignKey
public class ForeignKey
This class implements the foreign key functionality.
| Field Summary |
|---|
| Fields inherited from class edu.udo.cs.miningmart.m4.core.Key |
|---|
ATTRIB_HEAD_FK_CS, ATTRIB_HEAD_ID, ATTRIB_HEAD_NAME, ATTRIB_HEAD_PK_CS, M4_TABLE_NAME, m4Info |
| Fields inherited from class edu.udo.cs.miningmart.m4.core.M4Data |
|---|
myDocumentation |
| Fields inherited from class edu.udo.cs.miningmart.m4.core.M4Object |
|---|
myId, myName |
| Fields inherited from interface edu.udo.cs.miningmart.m4.utils.XmlInfo |
|---|
M4_XML_VERSION, TAG_COLLECTION, TAG_DOUBLE, TAG_INTEGER, TAG_LONG, TAG_M4_ID, TAG_SHORT, TAG_STRING, TAG_XML_ID |
| Fields inherited from interface edu.udo.cs.miningmart.m4.utils.M4Table |
|---|
NOT_NULL |
| Constructor Summary | |
|---|---|
ForeignKey(DB m4Db)
Constructor for ForeignKeyImpl. |
|
| Method Summary | |
|---|---|
void |
addColumnLink(Column fkColumn,
Column pkColumn)
Adds a Column Link to this ForeignKey. |
ForeignKey |
copy(Columnset newColumnSet)
|
void |
createColumnLinksFromAttribs(java.util.Collection fromAttribs,
java.util.Collection toAttribs)
Creates ColumnLinks between each given fromAttrib (must be BaseAttributes) and its corresponding toAttrib. |
protected void |
deleteLocal()
This method is called after the generic delete and can be overridden to delete related objects stored in cross-tables etc. |
java.util.Collection |
getAllColumnLinks()
This method returns a Collection of ForeignKeyLinks. |
protected Column |
getColumn(KeyMember km)
|
java.util.Collection |
getDependentObjects()
This method is part of the XML-serialization and needs to be implemented by all M4Data sub-classes that need to be serialized. |
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. |
protected java.util.Collection |
getObjectsInNamespace(java.lang.Class typeOfObjects)
This method returns the objects of the specified type that form a namespace in the scope of this M4Data object. |
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 |
primitiveSetForeignKeyColumnset(Columnset cs)
Primitive setter, do not use it! |
void |
primitiveSetPrimaryKeyColumnset(Columnset cs)
Primitive setter, do not use it! |
void |
removeAllColumnLinks()
Empties this ForeignKey of all Column Links. |
void |
removeColumn(java.lang.String name)
Removing a Column from the Key, but not from the Columnset the Column belongs to. |
void |
removeColumnLink(java.lang.String name)
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. |
void |
setRelationPrimitive(Relation r)
Primitive setter. |
| Methods inherited from class edu.udo.cs.miningmart.m4.core.Key |
|---|
addMember, deleteSoon, getIdAttributeName, getM4Info, getM4TableName, getMembers, getXmlInfo, print, removeAllColumns, removeAllM4References, removeMemberByForeignColumnName, removeMemberByPrimaryColumnName, removeMembers, setMembers |
| Methods inherited from class edu.udo.cs.miningmart.m4.core.M4Data |
|---|
exportLocal, genericGetter, genericSetter, getDocumentation, getObjectsReferencingMe, getObjectsReferencingMe, getObjectTag, getUniqueName, getValidName, getValidName, getXmlIdTag, getXmlVersion, hasDeleteStatus, importLocal, isDirty, isWaitingForDelete, primitiveGetDocObject, primitiveSetDocObject, readFromDb, readFromDbLocal, removeDocObject, removeFromDb, removeSetFromDb, setDirty, setDocumentation, setId, setName, storeLocal, updateObjectsFromTable |
| Methods inherited from class edu.udo.cs.miningmart.m4.core.M4Object |
|---|
compareTo, doPrint, doPrint, equals, executeBusinessSingleValueSqlRead, executeBusinessSingleValueSqlReadL, executeBusinessSqlRead, executeBusinessSqlWrite, executeM4SingleValueSqlRead, executeM4SingleValueSqlReadL, executeM4SqlRead, executeM4SqlWrite, getCasePrintObject, getId, getM4Db, getM4ObjectFromCache, getName, getNextM4SequenceValue, isNew, load, putM4ObjectToCache, replaceSpacesInName, setNotNew |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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, setNotNew |
| Methods inherited from interface edu.udo.cs.miningmart.m4.utils.XmlInfo |
|---|
doPrint, doPrint, exportLocal, genericGetter, genericSetter, getObjectTag, getXmlIdTag, getXmlVersion, importLocal |
| Constructor Detail |
|---|
public ForeignKey(DB m4Db)
m4Db - The DB object| Method Detail |
|---|
protected java.util.Collection getObjectsInNamespace(java.lang.Class typeOfObjects)
throws M4Exception
M4Datanull. If a namespace could
exist but doesn't, an empty Collection is returned.
getObjectsInNamespace in class M4DatatypeOfObjects - the type of objects that form the namespace
typeOfObjects,
or null.
M4ExceptionM4Data.getObjectsInNamespace(Class)protected Column getColumn(KeyMember km)
edu.udo.cs.miningmart.m4.Key#getColumn(KeyMember)
public void addColumnLink(Column fkColumn,
Column pkColumn)
throws M4Exception
ForeignKey
addColumnLink in interface ForeignKeyfkColumn - The foreign key Column to add to this ForeignKey.pkColumn - The primary key Column that is referenced by fkColumn.
M4Exceptionminingmart.m4.ForeignKey#addColumn(Column, Column)
public void createColumnLinksFromAttribs(java.util.Collection fromAttribs,
java.util.Collection toAttribs)
throws M4Exception
createColumnLinksFromAttribs in interface ForeignKeyfromAttribs - A collection of BaseAttributes, ordered to match the BaseAttributes
in 'toAttribs'toAttribs - A collection of BaseAttributes ordered so that each BaseAttribute
is mapped to the BaseAttribute in 'fromAttribs' at the same position
M4Exception
public boolean isColumnContainedInForeignColumns(Column theColumn)
throws M4Exception
ForeignKey
isColumnContainedInForeignColumns in interface ForeignKeytheColumn - the given Column
M4Exception
public boolean isColumnContainedInPrimaryColumns(Column theColumn)
throws M4Exception
ForeignKey
isColumnContainedInPrimaryColumns in interface ForeignKeytheColumn - the given Column
M4Exception
public Column getPrimaryForForeignColumn(Column theForeignKeyColumn)
throws M4Exception
ForeignKey
getPrimaryForForeignColumn in interface ForeignKeytheForeignKeyColumn - the given foreign key column
M4Exception
public Column getForeignForPrimaryColumn(Column thePrimaryKeyColumn)
throws M4Exception
ForeignKey
getForeignForPrimaryColumn in interface ForeignKeythePrimaryKeyColumn - the given primary key column
M4Exception
public ForeignKey copy(Columnset newColumnSet)
throws M4Exception
copy in interface ForeignKeyM4Exceptionedu.udo.cs.miningmart.m4.ForeignKey#copy(ColumnSet)
public Columnset getPrimaryKeyColumnset()
throws M4Exception
getPrimaryKeyColumnset in interface ForeignKeygetPrimaryKeyColumnset in interface KeygetPrimaryKeyColumnset in class KeyM4Exception
public void setPrimaryKeyColumnset(Columnset cs)
throws M4Exception
setPrimaryKeyColumnset in interface ForeignKeysetPrimaryKeyColumnset in interface KeysetPrimaryKeyColumnset in class Keycs - The new columnset of the primary key of this Key
M4Exception
public void removePrimaryKeyColumnset()
throws M4Exception
removePrimaryKeyColumnset in interface ForeignKeyM4Exceptionpublic void primitiveSetPrimaryKeyColumnset(Columnset cs)
primitiveSetPrimaryKeyColumnset in class Key
public Columnset getForeignKeyColumnset()
throws M4Exception
getForeignKeyColumnset in interface ForeignKeygetForeignKeyColumnset in interface KeygetForeignKeyColumnset in class KeyM4Exception
public void setForeignKeyColumnset(Columnset cs)
throws M4Exception
setForeignKeyColumnset in interface ForeignKeysetForeignKeyColumnset in interface KeysetForeignKeyColumnset in class Keycs - The new columnset of the foreign key of this Key
M4Exception
public void removeForeignKeyColumnset()
throws M4Exception
removeForeignKeyColumnset in interface ForeignKeyM4Exceptionpublic void primitiveSetForeignKeyColumnset(Columnset cs)
primitiveSetForeignKeyColumnset in class Key
public void removeColumn(java.lang.String name)
throws M4Exception
Key
removeColumn in class KeyM4Exception
public void removeColumnLink(java.lang.String name)
throws M4Exception
ForeignKey
removeColumnLink in interface ForeignKeyM4Exception
public void removeAllColumnLinks()
throws M4Exception
ForeignKey
removeAllColumnLinks in interface ForeignKeyM4Exception
public Relation getRelation()
throws M4Exception
getRelation in interface ForeignKeyM4Exception
public void setRelation(Relation rel,
boolean isFrom)
throws M4Exception
setRelation in interface ForeignKeyrel - The Relation this Key is to be associated withisFrom - TRUE iff this key is the fromKey of that Relation,
FALSE if it is the toKey.
M4Exception
public java.util.Collection getAllColumnLinks()
throws M4Exception
ForeignKeyCollection of ForeignKeyLinks.
Each ForeignKeyLink links one Column of the foreign Columnset
to the corresponding Column of the primary Columnset.
getAllColumnLinks in interface ForeignKeyCollection of ForeignKeyLinks
M4Exception
public ForeignKeyLink getFirstColumnLink()
throws M4Exception
ForeignKey
getFirstColumnLink in interface ForeignKeyM4Exceptionpublic void setRelationPrimitive(Relation r)
public java.util.Collection getDependentObjects()
throws M4Exception
M4DataM4Data sub-classes that need to be serialized.
getDependentObjects in interface XmlInfogetDependentObjects in class KeyCollection of all M4Data Java objects
holding a foreign key reference to this object.
This method must never return null.
M4ExceptionM4Data.getDependentObjects()
protected void deleteLocal()
throws M4Exception
M4Data
deleteLocal in class M4DataM4Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||