edu.udo.cs.miningmart.m4.core
Class Key

java.lang.Object
  extended byedu.udo.cs.miningmart.m4.core.M4Object
      extended byedu.udo.cs.miningmart.m4.core.M4Data
          extended byedu.udo.cs.miningmart.m4.core.Key
All Implemented Interfaces:
java.lang.Comparable, Key, M4Data, M4Object, M4Table, java.io.Serializable, XmlInfo
Direct Known Subclasses:
ForeignKey, PrimaryKey

public abstract class Key
extends M4Data
implements XmlInfo, Key

This class represents an M4 Key. Its concrete subclasses are ForeignKey and PrimaryKey.

Version:
$Id: Key.java,v 1.4 2006/04/11 14:10:14 euler Exp $
Author:
Timm Euler
See Also:
Serialized Form

Field Summary
static java.lang.String ATTRIB_HEAD_FK_CS
           
static java.lang.String ATTRIB_HEAD_ID
           
static java.lang.String ATTRIB_HEAD_NAME
           
static java.lang.String ATTRIB_HEAD_PK_CS
           
static java.lang.String M4_TABLE_NAME
           
static M4Info m4Info
          Cache for getM4Info()
 
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
Key(DB m4Db)
          Constructor for Key.
 
Method Summary
protected  void addMember(KeyMember newMember)
          Add a new KeyMember to this Keyhead.
 void deleteSoon()
          Overwrites the superclass method because the members of this key must be deleted, too.
 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.
abstract  Columnset getForeignKeyColumnset()
           
 java.lang.String getIdAttributeName()
           
 M4Info getM4Info()
           
 java.lang.String getM4TableName()
           
 java.util.Collection getMembers()
          Get all Members of this Keyhead.
abstract  Columnset getPrimaryKeyColumnset()
           
 M4Info getXmlInfo()
           
abstract  void primitiveSetForeignKeyColumnset(Columnset fkCs)
           
abstract  void primitiveSetPrimaryKeyColumnset(Columnset pkCs)
           
 void print()
          Used to print information about this object.
 void removeAllColumns()
           
protected  void removeAllM4References()
          This method needs to be implemented by all M4Data objects.
abstract  void removeColumn(java.lang.String name)
          Removing a Column from the Key, but not from the Columnset the Column belongs to.
protected  void removeMemberByForeignColumnName(java.lang.String name)
          Removes that KeyMember whose foreign key Column has the given name from this KeyHead (without deleting it).
protected  void removeMemberByPrimaryColumnName(java.lang.String name)
          Removes that KeyMember whose primary key Column has the given name from this KeyHead (without deleting it).
protected  void removeMembers()
          Remove all KeyMembers from this KeyHead.
abstract  void setForeignKeyColumnset(Columnset fkCs)
           
protected  void setMembers(java.util.Collection newMembers)
          Associate this Key with the given Collection of KeyMembers.
abstract  void setPrimaryKeyColumnset(Columnset pkCs)
           
 
Methods inherited from class edu.udo.cs.miningmart.m4.core.M4Data
deleteLocal, exportLocal, genericGetter, genericSetter, getDocumentation, getObjectsInNamespace, getObjectsReferencingMe, getObjectsReferencingMe, getObjectTag, 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
 
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.utils.XmlInfo
doPrint, doPrint, exportLocal, genericGetter, genericSetter, getObjectTag, getXmlIdTag, getXmlVersion, importLocal
 
Methods inherited from interface edu.udo.cs.miningmart.m4.M4Data
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, putM4ObjectToCache, replaceSpacesInName, setId, setName
 

Field Detail

M4_TABLE_NAME

public static final java.lang.String M4_TABLE_NAME
See Also:
Constant Field Values

ATTRIB_HEAD_ID

public static final java.lang.String ATTRIB_HEAD_ID
See Also:
Constant Field Values

ATTRIB_HEAD_NAME

public static final java.lang.String ATTRIB_HEAD_NAME
See Also:
Constant Field Values

ATTRIB_HEAD_PK_CS

public static final java.lang.String ATTRIB_HEAD_PK_CS
See Also:
Constant Field Values

ATTRIB_HEAD_FK_CS

public static final java.lang.String ATTRIB_HEAD_FK_CS
See Also:
Constant Field Values

m4Info

public static M4Info m4Info
Cache for getM4Info()

Constructor Detail

Key

public Key(DB m4Db)
Constructor for Key.

Parameters:
m4Db -
See Also:
edu.udo.cs.miningmart.m4.core.M4Object#Constructor
Method Detail

getM4TableName

public java.lang.String getM4TableName()
Specified by:
getM4TableName in interface M4Table
See Also:
M4Table.getM4TableName()

getIdAttributeName

public java.lang.String getIdAttributeName()
Specified by:
getIdAttributeName in interface M4Table
See Also:
M4Table.getIdAttributeName()

getM4Info

public M4Info getM4Info()
Specified by:
getM4Info in interface M4Table
See Also:
M4Table.getM4Info()

getXmlInfo

public M4Info getXmlInfo()
Specified by:
getXmlInfo in interface XmlInfo
Returns:
a M4Info object with the information of all XML fields of this object.
See Also:
XmlInfo.getXmlInfo()

print

public void print()
Used to print information about this object.

Specified by:
print in interface M4Object
Specified by:
print in class M4Object
See Also:
M4Object.print()

setPrimaryKeyColumnset

public abstract void setPrimaryKeyColumnset(Columnset pkCs)
                                     throws M4Exception
Specified by:
setPrimaryKeyColumnset in interface Key
Throws:
M4Exception

setForeignKeyColumnset

public abstract void setForeignKeyColumnset(Columnset fkCs)
                                     throws M4Exception
Specified by:
setForeignKeyColumnset in interface Key
Throws:
M4Exception

primitiveSetPrimaryKeyColumnset

public abstract void primitiveSetPrimaryKeyColumnset(Columnset pkCs)
                                              throws M4Exception
Throws:
M4Exception

primitiveSetForeignKeyColumnset

public abstract void primitiveSetForeignKeyColumnset(Columnset fkCs)
                                              throws M4Exception
Throws:
M4Exception

getPrimaryKeyColumnset

public abstract Columnset getPrimaryKeyColumnset()
                                          throws M4Exception
Specified by:
getPrimaryKeyColumnset in interface Key
Throws:
M4Exception

getForeignKeyColumnset

public abstract Columnset getForeignKeyColumnset()
                                          throws M4Exception
Specified by:
getForeignKeyColumnset in interface Key
Throws:
M4Exception

addMember

protected void addMember(KeyMember newMember)
                  throws M4Exception
Add a new KeyMember to this Keyhead.

Throws:
M4Exception
See Also:
KeyMember

removeMemberByPrimaryColumnName

protected void removeMemberByPrimaryColumnName(java.lang.String name)
                                        throws M4Exception
Removes that KeyMember whose primary key Column has the given name from this KeyHead (without deleting it).

Parameters:
name - The name
Throws:
M4Exception

removeMemberByForeignColumnName

protected void removeMemberByForeignColumnName(java.lang.String name)
                                        throws M4Exception
Removes that KeyMember whose foreign key Column has the given name from this KeyHead (without deleting it).

Parameters:
name - The name
Throws:
M4Exception

getMembers

public java.util.Collection getMembers()
                                throws M4Exception
Get all Members of this Keyhead.

Returns:
A Collection of KeyMembers.
Throws:
M4Exception

removeMembers

protected void removeMembers()
Remove all KeyMembers from this KeyHead. Only the association is removed, but the members are not deleted.


setMembers

protected void setMembers(java.util.Collection newMembers)
                   throws M4Exception
Associate this Key with the given Collection of KeyMembers.

Parameters:
newMembers - a Collection of KeyMembers
Throws:
M4Exception

deleteSoon

public void deleteSoon()
                throws M4Exception
Overwrites the superclass method because the members of this key must be deleted, too.

Specified by:
deleteSoon in interface M4Data
Overrides:
deleteSoon in class M4Data
Throws:
M4Exception

removeAllM4References

protected void removeAllM4References()
                              throws M4Exception
Description copied from class: M4Data
This method needs to be implemented by all M4Data objects. It has to remove all references to other M4Objects.

Specified by:
removeAllM4References in class M4Data
Throws:
M4Exception
See Also:
M4Data.removeAllM4References()

getDependentObjects

public java.util.Collection getDependentObjects()
                                         throws M4Exception
Description copied from class: M4Data
This method is part of the XML-serialization and needs to be implemented by all M4Data sub-classes that need to be serialized.

Specified by:
getDependentObjects in interface XmlInfo
Overrides:
getDependentObjects in class M4Data
Returns:
a Collection of all M4Data Java objects holding a foreign key reference to this object. This method must never return null.
Throws:
M4Exception
See Also:
M4Data.getDependentObjects()

removeColumn

public abstract void removeColumn(java.lang.String name)
                           throws M4Exception
Removing a Column from the Key, but not from the Columnset the Column belongs to. In the case of ForeignKey, a Column Link is removed.

Throws:
M4Exception

removeAllColumns

public void removeAllColumns()
                      throws M4Exception
Throws:
M4Exception


Copyright © 2001-2005