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

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.Case
All Implemented Interfaces:
Case, java.lang.Comparable, M4Data, M4Object, M4Table, java.io.Serializable, XmlInfo

public class Case
extends M4Data
implements XmlInfo, Case

Class to represent a case. Currently only the name and the related step sequence are stored!

Version:
$Id: Case.java,v 1.6 2006/04/11 14:10:14 euler Exp $
Author:
Martin Scholz
See Also:
Serialized Form

Field Summary
static java.lang.String ATTRIB_CASE_ID
          DB level: The database attribute storing the case IDs
static java.lang.String ATTRIB_CASE_MODE
          DB level: The database attribute storing the mode (state) of the case
static java.lang.String ATTRIB_CASE_NAME
          DB level: The database attribute storing the case names
static java.lang.String FINALMODE
          The field value for the FINAL case mode.
static java.lang.String M4_TABLE_NAME
          The M4 table name storing case information.
static M4Info m4Info
          Cache for getM4Info()
static java.lang.String TESTMODE
          The field value for the TEST case mode.
 
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.Case
DESIGN_MODE, FINAL_MODE, TEST_MODE
 
Fields inherited from interface edu.udo.cs.miningmart.m4.utils.M4Table
NOT_NULL
 
Constructor Summary
Case(DB m4Db)
           
 
Method Summary
 void addChain(Chain chain)
          Adds a new Chain to this case.
 void addConcept(Concept con)
          Adds a new Concept to this case.
 void addStep(Step step)
          Adds a Step to this Case.
 void addStepDependency(Step before, Step after)
          This method adds dependencies between Steps and brings the Steps in a sequential order again, if necessary and if they have been in sequential order before adding the dependency.
 int compareTo(java.lang.Object o)
           
 boolean containsDependency(Step before, Step after)
          Checks for a direct (explicitly added) dependency between the two Steps.
 Case copy()
           
 Chain createChain(java.lang.String name)
          Creates an empty Chain belonging to this Case.
 Chain createChain(java.lang.String name, java.util.Collection stepsAndChains)
          Creates a Chain that belongs to this Case.
 Concept createConcept(java.lang.String name, java.lang.String type)
          Creates an empty Concept belonging to this Case.
 Concept createConceptAndRelationsFromTables(java.lang.String tableName)
          This method creates a Columnset and Concept for the given table/view name, and also creates a Columnset and Concept for EVERY table that is referenced from the first one by a foreign key reference, and also creates an M4 Relation for those references.
 Concept createConceptFromColumnset(Columnset cs)
          Creates a Concept that belongs to this Case and is connected to the given Columnset.
 Concept createConceptFromTable(java.lang.String tableName)
          Creates a Concept that belongs to this Case and that directly models a database table or view with the given name.
 Relation createManyToManyRelation(java.lang.String relName, java.util.Collection fromConceptKeyAttribs, java.util.Collection toConceptKeyAttribs, java.lang.String crossTableName, java.util.Collection crossLinkToFromConceptNames, java.util.Collection crossLinkToToConceptNames)
          Creates a many-to-many relation.
 java.util.Collection createManyToManyRelationsFromCrossTable(java.lang.String crossTableName)
          Creates many-to-many relations with the given table name as cross table.
 Relation createOneToManyRelation(java.lang.String relName, java.util.Collection fromConceptKeyAttribs, java.util.Collection toConceptKeyAttribs)
          Creates a one-to-many relation.
 Step createStep(java.lang.String name)
          Creates an empty Step belonging to this Case.
 java.util.Collection getAllChains()
          Active getter of the Chains of this Case.
 java.util.Collection getAllConceptNames()
          Gets the names of all concepts.
 java.util.Collection getAllProjections()
          Returns all Projections that this Case has.
 java.util.Collection getAllRelations()
          Returns all Relations that this Case has.
 java.util.Collection getAllStepNames()
          Returns a Collection with all Step names in the current Case.
 Chain getChainByName(java.lang.String name)
          Retrieve a Chain by its name.
 Concept getConcept(java.lang.String conceptName)
           
 java.util.Collection getConcepts()
          Active getter of the Concepts of this Case.
 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.
 java.util.Collection getDependentStepsFor(Step step)
          Gets a Collection of the stepIds that are dependent on the given step, ie must be compiled after the given step.
 java.util.Collection getDirectlyDependentSteps(Step step)
          Gets a Collection of the steps that are directly dependent on the given step.
 java.lang.String getIdAttributeName()
           
 java.util.Collection getInputDataModel()
          Returns a collection of all concepts that are used as input in some step, but not created as an output concept in this Case.
 M4Info getM4Info()
           
 java.lang.String getM4TableName()
           
 int getNumberOfSteps()
           
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.
 java.util.Map getOperatorToStepMap()
          Returns a map that maps operators that occur in this case to a collection of the steps in which they occur.
 Step getPredecessorIdOf(Step step)
          Gets the predecessor step, given the calculated sequential order.
 java.util.Iterator getReverseIterator()
           
 Step getStepByName(java.lang.String name)
          This method finds a Step related to this Case by the Step's M4 name
 Step getStepIdNo(int i)
          Gets the step i in sequential order.
 java.util.Iterator getStepIterator()
           
 java.util.Collection getStepsToCompileBefore(Step step, boolean ignoreCompiledStatusOfSteps)
          This method returns a Collection of all Steps on which the given Step is dependent.
 Step getSuccessorOf(Step step)
          Gets the successor step, given the calculated sequential order.
 java.lang.String getTheMode()
          Get the Case mode.
 java.util.Vector getTheSteps()
          Active getter
 java.util.Collection getTopLevelChains()
          Active getter of the Chains of this Case.
 M4Info getXmlInfo()
           
 int indexOfStep(Step step)
           
 void print()
          Method to print data about this M4Object.
protected  void removeAllM4References()
          This method needs to be implemented by all M4Data objects.
 void removeAllSteps()
          All Steps of a Case will be removed including their Parameters.
 boolean removeChain(Chain chain)
          Removes a Chain from this case.
 void removeChain(java.lang.String name)
          Remove a Chain by its name.
 boolean removeConcept(Concept con)
          Removes a Concept from this case.
 boolean removeStep(Step step)
          Removes a Step and all of its dependencies from this Case.
 void removeStep(java.lang.String name)
          The specified Step will be removed including its Parameters.
 boolean removeStepDependency(Step before, Step after)
          A dependency (or edge in graph terminology) between the two Steps is removed.
 void resolveChain(Chain toBeResolved)
          The given chain will be resolved if it is a top level chain and if it does not have any Steps, only subchains.
 void setTheMode(java.lang.String newMode)
          Set the Case mode.
 void store()
          Write all M4 data pertaining to this case through to the database.
 
Methods inherited from class edu.udo.cs.miningmart.m4.core.M4Data
deleteLocal, deleteSoon, exportLocal, genericGetter, genericSetter, getDocumentation, 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
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
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, putM4ObjectToCache, replaceSpacesInName, setId, setName
 

Field Detail

M4_TABLE_NAME

public static final java.lang.String M4_TABLE_NAME
The M4 table name storing case information.

See Also:
Constant Field Values

ATTRIB_CASE_ID

public static final java.lang.String ATTRIB_CASE_ID
DB level: The database attribute storing the case IDs

See Also:
Constant Field Values

ATTRIB_CASE_NAME

public static final java.lang.String ATTRIB_CASE_NAME
DB level: The database attribute storing the case names

See Also:
Constant Field Values

ATTRIB_CASE_MODE

public static final java.lang.String ATTRIB_CASE_MODE
DB level: The database attribute storing the mode (state) of the case

See Also:
Constant Field Values

TESTMODE

public static final java.lang.String TESTMODE
The field value for the TEST case mode.

See Also:
Constant Field Values

FINALMODE

public static final java.lang.String FINALMODE
The field value for the FINAL case mode.

See Also:
Constant Field Values

m4Info

public static M4Info m4Info
Cache for getM4Info()

Constructor Detail

Case

public Case(DB m4Db)
See Also:
edu.udo.cs.miningmart.m4.core.M4Data#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()

addStepDependency

public void addStepDependency(Step before,
                              Step after)
                       throws M4Exception
This method adds dependencies between Steps and brings the Steps in a sequential order again, if necessary and if they have been in sequential order before adding the dependency.

Specified by:
addStepDependency in interface Case
Parameters:
before - a Step part of this Case
after - a Step part of this Case and depending on Step before.
Throws:
M4Exception

containsDependency

public boolean containsDependency(Step before,
                                  Step after)
                           throws M4Exception
Checks for a direct (explicitly added) dependency between the two Steps.

Specified by:
containsDependency in interface Case
Returns:
true if the second Step directly depends on the first one. If one of the Steps is not part of the Case then false is returned.
Throws:
M4Exception

removeStepDependency

public boolean removeStepDependency(Step before,
                                    Step after)
                             throws M4Exception
A dependency (or edge in graph terminology) between the two Steps is removed.

Specified by:
removeStepDependency in interface Case
Parameters:
before - a Step part of this Case
after - a Step part of this Case, and depending on Step before
Returns:
true iff the dependency was found and could be removed
Throws:
M4Exception

getObjectsInNamespace

protected java.util.Collection getObjectsInNamespace(java.lang.Class typeOfObjects)
                                              throws M4Exception
Description copied from class: M4Data
This method returns the objects of the specified type that form a namespace in the scope of this M4Data object. For example, a Concept's namespace for the type BaseAttribute is the Collection of all BaseAttributes for this Concept. Many M4Data objects never have a namespace, they return null. If a namespace could exist but doesn't, an empty Collection is returned.

Specified by:
getObjectsInNamespace in class M4Data
Parameters:
typeOfObjects - the type of objects that form the namespace
Returns:
a Collection of objects of type typeOfObjects, or null.
Throws:
M4Exception
See Also:
M4Data.getObjectsInNamespace(Class)

getAllRelations

public java.util.Collection getAllRelations()
                                     throws M4Exception
Returns all Relations that this Case has.

Specified by:
getAllRelations in interface Case
Returns:
a Collection of Relations
Throws:
M4Exception

getAllProjections

public java.util.Collection getAllProjections()
                                       throws M4Exception
Returns all Projections that this Case has.

Returns:
a Collection of Projections
Throws:
M4Exception

getOperatorToStepMap

public java.util.Map getOperatorToStepMap()
                                   throws M4Exception
Description copied from interface: Case
Returns a map that maps operators that occur in this case to a collection of the steps in which they occur.

Specified by:
getOperatorToStepMap in interface Case
Returns:
a map from operators to collections of steps
Throws:
M4Exception

setTheMode

public void setTheMode(java.lang.String newMode)
                throws M4Exception
Set the Case mode. Allowed constants are given by the public static variables TESTMODE and FINALMODE of this class.

Specified by:
setTheMode in interface Case
Parameters:
newMode - The new case mode. Use the public static variables TESTMODE and FINALMODE of this class.
Throws:
M4Exception

getTheMode

public java.lang.String getTheMode()
Get the Case mode.

Specified by:
getTheMode in interface Case
Returns:
A String with the value of one of the public static fields TESTMODE and FINALMODE of this class.

print

public void print()
Description copied from interface: M4Object
Method to print data about this M4Object.

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

getStepIdNo

public Step getStepIdNo(int i)
                 throws M4Exception
Gets the step i in sequential order.

Specified by:
getStepIdNo in interface Case
Returns:
Returns a step
Throws:
M4Exception

getNumberOfSteps

public int getNumberOfSteps()
                     throws M4Exception
Specified by:
getNumberOfSteps in interface Case
Returns:
the number of steps of this case.
Throws:
M4Exception

getPredecessorIdOf

public Step getPredecessorIdOf(Step step)
                        throws M4Exception
Gets the predecessor step, given the calculated sequential order.

Specified by:
getPredecessorIdOf in interface Case
Parameters:
step - The step for which the predecessor is wanted.
Returns:
the predecessor step
Throws:
M4Exception

getSuccessorOf

public Step getSuccessorOf(Step step)
                    throws M4Exception
Gets the successor step, given the calculated sequential order.

Specified by:
getSuccessorOf in interface Case
Parameters:
step - The step for which the successor is wanted.
Returns:
the successor step
Throws:
M4Exception

indexOfStep

public int indexOfStep(Step step)
                throws M4Exception
Specified by:
indexOfStep in interface Case
Returns:
the index of the Step with the given Id, if part of this case. The result depends of the chosen (but fixed) sequential order of the Sequentializer!
Throws:
M4Exception

getStepIterator

public java.util.Iterator getStepIterator()
                                   throws M4Exception
Specified by:
getStepIterator in interface Case
Returns:
an Iterator providing the Steps of this Case. The order depends on the Sequentializer.
Throws:
M4Exception

getReverseIterator

public java.util.Iterator getReverseIterator()
                                      throws M4Exception
Specified by:
getReverseIterator in interface Case
Returns:
an Iterator providing the Steps in reverse order. The order depends on the Sequentializer!
Throws:
M4Exception

getDependentStepsFor

public java.util.Collection getDependentStepsFor(Step step)
                                          throws M4Exception
Gets a Collection of the stepIds that are dependent on the given step, ie must be compiled after the given step.

Specified by:
getDependentStepsFor in interface Case
Returns:
The dependent steps as a Collection.
Throws:
M4Exception

getStepsToCompileBefore

public java.util.Collection getStepsToCompileBefore(Step step,
                                                    boolean ignoreCompiledStatusOfSteps)
                                             throws M4Exception
This method returns a Collection of all Steps on which the given Step is dependent. That means, all Steps are returned that must be compiled before the given Step can be compiled, and they are returned in the order in which they must be compiled. By the parameter ignoreCompiledStatusOfSteps, one can specify whether the method considers only the graph structure of M4 Step dependencies, and ignores whether some of the Steps to be returned have already been compiled (and thus would not have to be compiled again) - or whether this compilation status of Steps should be taken into account. In the latter case, the backwards search for predecessors of the given Step ends, on every path that leads to the given Step, at the first Step that is already compiled.

Specified by:
getStepsToCompileBefore in interface Case
Parameters:
step - the Step whose preceding graph is returned
ignoreCompiledStatusOfSteps - if TRUE, *all* Steps that lead to the given Step are returned; if FALSE, only those starting at the last compiled Step on each path that leads to the given Step are returned.
Returns:
an ordered Collection of all Steps that must be compiled before the given Step can be compiled
Throws:
M4Exception

getDirectlyDependentSteps

public java.util.Collection getDirectlyDependentSteps(Step step)
                                               throws M4Exception
Gets a Collection of the steps that are directly dependent on the given step. This is useful for the HCI to just visualize the explicitly stored dependencies.

Specified by:
getDirectlyDependentSteps in interface Case
Parameters:
step - The step for which the dependent steps are wanted.
Returns:
The dependent steps as a Collection or null, if the specified Step is not found.
Throws:
M4Exception

getConcepts

public java.util.Collection getConcepts()
                                 throws M4Exception
Active getter of the Concepts of this Case.

Specified by:
getConcepts in interface Case
Returns:
a Collection of Concepts
Throws:
M4Exception

getInputDataModel

public java.util.Collection getInputDataModel()
                                       throws M4Exception
Returns a collection of all concepts that are used as input in some step, but not created as an output concept in this Case.

Specified by:
getInputDataModel in interface Case
Returns:
a Collection of Concepts
Throws:
M4Exception

addConcept

public void addConcept(Concept con)
                throws M4Exception
Adds a new Concept to this case.

Specified by:
addConcept in interface Case
Parameters:
con - the new Concept
Throws:
M4Exception

removeConcept

public boolean removeConcept(Concept con)
                      throws M4Exception
Removes a Concept from this case.

Specified by:
removeConcept in interface Case
Parameters:
con - the Concept to be removed
Returns:
true if Concept was found and could be removed
Throws:
M4Exception

getAllChains

public java.util.Collection getAllChains()
                                  throws M4Exception
Active getter of the Chains of this Case.

Specified by:
getAllChains in interface Case
Returns:
a Collection of Chains
Throws:
M4Exception

getTopLevelChains

public java.util.Collection getTopLevelChains()
                                       throws M4Exception
Description copied from interface: Case
Active getter of the Chains of this Case. Attention: It returns ONLY the top-level chains of this Case, that is, the Chains that do not have a parent chain. Compare to method getAllChains.

Specified by:
getTopLevelChains in interface Case
Returns:
a Collection of Chains
Throws:
M4Exception

getChainByName

public Chain getChainByName(java.lang.String name)
                     throws M4Exception
Description copied from interface: Case
Retrieve a Chain by its name.

Specified by:
getChainByName in interface Case
Parameters:
name - the Name
Throws:
M4Exception

addChain

public void addChain(Chain chain)
              throws M4Exception
Adds a new Chain to this case.

Specified by:
addChain in interface Case
Parameters:
chain - the new Chain
Throws:
M4Exception

removeChain

public boolean removeChain(Chain chain)
                    throws M4Exception
Removes a Chain from this case.

Specified by:
removeChain in interface Case
Parameters:
chain - the Chain to be removed
Returns:
true if Chain was found and could be removed
Throws:
M4Exception

removeChain

public void removeChain(java.lang.String name)
                 throws M4Exception
Description copied from interface: Case
Remove a Chain by its name.

Specified by:
removeChain in interface Case
Parameters:
name - the Name
Throws:
M4Exception

getStepByName

public Step getStepByName(java.lang.String name)
                   throws M4Exception
This method finds a Step related to this Case by the Step's M4 name

Specified by:
getStepByName in interface Case
Parameters:
name - the name of the Step object
Returns:
the Step or null
Throws:
M4Exception

getTheSteps

public java.util.Vector getTheSteps()
                             throws M4Exception
Active getter

Specified by:
getTheSteps in interface Case
Returns:
a Collection of all Steps of this Case
Throws:
M4Exception

addStep

public void addStep(Step step)
             throws M4Exception
Adds a Step to this Case.

Specified by:
addStep in interface Case
Parameters:
step - the Step to be added
Throws:
M4Exception

removeStep

public boolean removeStep(Step step)
                   throws M4Exception
Removes a Step and all of its dependencies from this Case.

Specified by:
removeStep in interface Case
Parameters:
step - the Step to be added
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()

store

public void store()
           throws M4Exception
Description copied from interface: Case
Write all M4 data pertaining to this case through to the database.

Specified by:
store in interface Case
Throws:
M4Exception
See Also:
M4Object#store()

copy

public Case copy()
          throws M4Exception
Specified by:
copy in interface Case
Throws:
M4Exception

createStep

public Step createStep(java.lang.String name)
                throws M4Exception
Creates an empty Step belonging to this Case. The name of the Step should be unique within the Case.

Specified by:
createStep in interface Case
Throws:
CreateException - when an error occurs during creation of the object.
NameExistsException - when the provided name already exists.
M4Exception

getAllStepNames

public java.util.Collection getAllStepNames()
                                     throws M4Exception
Returns a Collection with all Step names in the current Case.

Specified by:
getAllStepNames in interface Case
Throws:
M4Exception

removeStep

public void removeStep(java.lang.String name)
                throws M4Exception
The specified Step will be removed including its Parameters. Concepts and BaseAttributes of types BASE and DB however will not be removed.

Specified by:
removeStep in interface Case
Throws:
M4Exception

removeAllSteps

public void removeAllSteps()
                    throws M4Exception
All Steps of a Case will be removed including their Parameters. Concepts and BaseAttributes of types BASE and DB however will not be removed.

Specified by:
removeAllSteps in interface Case
Throws:
M4Exception

createChain

public Chain createChain(java.lang.String name)
                  throws M4Exception
Creates an empty Chain belonging to this Case. The name of the Chain should be unique within the Case. The new Chain will be a top-level Chain in this Case, that is, it must not get a parent.

Specified by:
createChain in interface Case
Parameters:
name - the name to be given to the new chain
Returns:
the created chain
Throws:
CreateException - when an error occurs during creation of the object.
NameExistsException - when the provided name already exists.
M4Exception

createChain

public Chain createChain(java.lang.String name,
                         java.util.Collection stepsAndChains)
                  throws M4Exception
Creates a Chain that belongs to this Case. The name of the Chain should be unique within the Case. All steps in the given collection are added as steps of the newly created chain. All chains in the given collection are added as direct subchains of the newly created chain.

Specified by:
createChain in interface Case
Parameters:
name - the name to be given to the new chain
stepsAndChains - a Collection of Steps and/or Chains.
Returns:
the created chain
Throws:
M4Exception
See Also:
Case.createChain(String, Collection)

resolveChain

public void resolveChain(Chain toBeResolved)
                  throws M4Exception
Description copied from interface: Case
The given chain will be resolved if it is a top level chain and if it does not have any Steps, only subchains. Otherwise an M4Exception is thrown. The subchains of the given chain will be new top-level chains of this Case.

Specified by:
resolveChain in interface Case
Throws:
M4Exception
See Also:
Case.resolveChain(Chain)

createConcept

public Concept createConcept(java.lang.String name,
                             java.lang.String type)
                      throws M4Exception
Description copied from interface: Case
Creates an empty Concept belonging to this Case. The name of the Concept must be unique within the Case.

Specified by:
createConcept in interface Case
Parameters:
name - the name for the concept to be created
type - the type of the concept (see Concept.TYPE_...)
Throws:
M4Exception
See Also:
Case.createConcept(String, String)

createConceptFromTable

public Concept createConceptFromTable(java.lang.String tableName)
                               throws M4Exception
Description copied from interface: Case
Creates a Concept that belongs to this Case and that directly models a database table or view with the given name. The concept will have exactly the given name. For each column of the table/view a BaseAttribute is created and attached to the Concept. The given name must be a valid name of a database table or view in the current business data schema, otherwise an exception is thrown.

Specified by:
createConceptFromTable in interface Case
Parameters:
tableName - the name of a table or view in the business schema
Throws:
M4Exception
See Also:
Case.createConceptFromTable(String)

createConceptFromColumnset

public Concept createConceptFromColumnset(Columnset cs)
                                   throws M4Exception
Description copied from interface: Case
Creates a Concept that belongs to this Case and is connected to the given Columnset. The concept directly reflects the Columnset, that is, its name and the names of the BaseAttributes are taken from the Columnset and its Columns.

Specified by:
createConceptFromColumnset in interface Case
Parameters:
cs - the given Columnset
Returns:
the new Concept
Throws:
M4Exception

createConceptAndRelationsFromTables

public Concept createConceptAndRelationsFromTables(java.lang.String tableName)
                                            throws M4Exception
This method creates a Columnset and Concept for the given table/view name, and also creates a Columnset and Concept for EVERY table that is referenced from the first one by a foreign key reference, and also creates an M4 Relation for those references. Concepts and Columnsets for the other tables/views are only created if no such object with the same name exists yet in the M4 cache. At the moment only one-to-many relations are created!

Specified by:
createConceptAndRelationsFromTables in interface Case
Parameters:
tableName - the given table name
Returns:
the first Concept, from which the referenced Concepts can be found by following the M4 Relations.
Throws:
M4Exception

createManyToManyRelationsFromCrossTable

public java.util.Collection createManyToManyRelationsFromCrossTable(java.lang.String crossTableName)
                                                             throws M4Exception
Description copied from interface: Case
Creates many-to-many relations with the given table name as cross table. This only works if the foreign key information is stored in the database.

Specified by:
createManyToManyRelationsFromCrossTable in interface Case
Parameters:
crossTableName -
Returns:
Throws:
M4Exception

createOneToManyRelation

public Relation createOneToManyRelation(java.lang.String relName,
                                        java.util.Collection fromConceptKeyAttribs,
                                        java.util.Collection toConceptKeyAttribs)
                                 throws M4Exception
Description copied from interface: Case
Creates a one-to-many relation. The name must be valid for this Case. There must be equally many Features in the from/to key attribute collections.

Specified by:
createOneToManyRelation in interface Case
Parameters:
relName - a valid name for a new Relation in this Case
fromConceptKeyAttribs - a Collection of the Features that make up the key attributes in the FromConcept
toConceptKeyAttribs - a Collection of the Features that make up the key attributes in the ToConcept
Returns:
the newly created Relation
Throws:
M4Exception

createManyToManyRelation

public Relation createManyToManyRelation(java.lang.String relName,
                                         java.util.Collection fromConceptKeyAttribs,
                                         java.util.Collection toConceptKeyAttribs,
                                         java.lang.String crossTableName,
                                         java.util.Collection crossLinkToFromConceptNames,
                                         java.util.Collection crossLinkToToConceptNames)
                                  throws M4Exception
Description copied from interface: Case
Creates a many-to-many relation. The name must be valid for this Case. There must be equally many Features in the from/to key attribute collections as there are names in the from/to cross link name collections.

Specified by:
createManyToManyRelation in interface Case
Parameters:
relName - a valid name for a new Relation in this Case
fromConceptKeyAttribs - a Collection of the Features that make up the key attributes in the FromConcept
toConceptKeyAttribs - a Collection of the Features that make up the key attributes in the ToConcept
crossTableName - the name of the table in the business data schema that serves as the cross table
crossLinkToFromConceptNames - a Collection with the names of the cross table columns that provide the foreign key to the primary key of the FromConcept
crossLinkToToConceptNames - a Collection with the names of the cross table columns that provide the foreign key to the primary key of the ToConcept
Returns:
the newly created Relation
Throws:
M4Exception

getConcept

public Concept getConcept(java.lang.String conceptName)
                   throws M4Exception
Specified by:
getConcept in interface Case
Throws:
M4Exception

getAllConceptNames

public java.util.Collection getAllConceptNames()
                                        throws M4Exception
Description copied from interface: Case
Gets the names of all concepts.

Specified by:
getAllConceptNames in interface Case
Returns:
The names (String).
Throws:
M4Exception
See Also:
getAllConceptNames()

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class M4Object
See Also:
Comparable.compareTo(Object)


Copyright © 2001-2005