edu.udo.cs.miningmart.m4
Interface Relation

All Superinterfaces:
GraphicalM4Object, M4Data, M4Object, ParameterObject
All Known Implementing Classes:
Relation

public interface Relation
extends ParameterObject

Version:
$Id: Relation.java,v 1.5 2006/04/11 14:10:12 euler Exp $
Author:
Timm Euler, Daniel Hakenjos

Method Summary
 void addSubRelationship(Relation relationship)
           
 Relation copy(Concept fromConcept, Concept toConcept)
           
 Columnset createCrossLinkColumnset(java.lang.String name, java.lang.String schema, java.lang.String type)
          Creates a ColumnSet that will be connected to this Relation.
 java.util.Collection getAllSubRelationships()
           
 Columnset getCrossLinkColumnSet()
           
 ForeignKey getFromKey()
          Getter method.
 Columnset getResultOfJoin()
          This method creates a Columnset that represents the inner join resulting from joining the FromConcept and the ToConcept.
 java.util.Collection getStepsWhereThisIsInputRelation()
          Returns all Steps in the Case that use this Relation as an input.
 Relation getSubRelation(java.lang.String name)
           
 java.util.Collection getSubRelations()
           
 Relation getSuperRelation()
           
 Concept getTheFromConcept()
          Getter method.
 Concept getTheToConcept()
          Getter method.
 ForeignKey getToKey()
          Getter method.
 boolean isManyToManyRelation()
          Returns true iff this Relation models an n:m relationship.
 boolean isOneToManyRelation()
          Returns true iff this Relation models a 1:n relationship.
 boolean isRelationallyValid()
          This method returns information about the relational validity of the object.
 void removeAllSubRelationships()
           
 void removeCrossLinkColumnset()
          Removes the ColumnSet for this Relation.
 void removeFromKey()
           
 void removeSubRelationship(java.lang.String name)
           
 void removeSuperRelation()
          Remove the link to the superRelationship.
 void removeToKey()
           
 void setCrossLinkColumnSet(Columnset cs)
          Setter method.
 void setFromKey(ForeignKey newFromKey)
          Setter method.
 void setM2mKeys(ForeignKey fromFK, ForeignKey toFK)
          Sets the key fields that define a many-to-many relationship on the relational level for this Relationship.
 void setSuperRelation(Relation superRelationship)
           
 void setTheFromConcept(Concept c)
          Setter method.
 void setTheToConcept(Concept c)
          Setter method.
 void setToKey(ForeignKey newToKey)
          Setter method.
 
Methods inherited from interface edu.udo.cs.miningmart.m4.ParameterObject
addParameterReference, getParameterReferences, removeParameterReference
 
Methods inherited from interface edu.udo.cs.miningmart.m4.GraphicalM4Object
getPoint, setPoint
 
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

setTheToConcept

public void setTheToConcept(Concept c)
                     throws M4Exception
Setter method.

Parameters:
c - the new value
Throws:
M4Exception

getTheToConcept

public Concept getTheToConcept()
                        throws M4Exception
Getter method.

Returns:
the value
Throws:
M4Exception

setTheFromConcept

public void setTheFromConcept(Concept c)
                       throws M4Exception
Setter method.

Parameters:
c - the new value
Throws:
M4Exception

getTheFromConcept

public Concept getTheFromConcept()
                          throws M4Exception
Getter method.

Returns:
the value
Throws:
M4Exception

getResultOfJoin

public Columnset getResultOfJoin()
                          throws M4Exception
This method creates a Columnset that represents the inner join resulting from joining the FromConcept and the ToConcept. The M4 Columns are also created. However, the view corresponding to the new Columnset is not created in the database.

Returns:
a Columnset
Throws:
M4Exception

getStepsWhereThisIsInputRelation

public java.util.Collection getStepsWhereThisIsInputRelation()
                                                      throws M4Exception
Returns all Steps in the Case that use this Relation as an input.

Returns:
a Collection of Steps
Throws:
M4Exception

setToKey

public void setToKey(ForeignKey newToKey)
              throws M4Exception
Setter method.

Parameters:
newToKey - the new toKey
Throws:
M4Exception

getToKey

public ForeignKey getToKey()
                    throws M4Exception
Getter method.

Returns:
the value
Throws:
M4Exception

removeToKey

public void removeToKey()
                 throws M4Exception
Throws:
M4Exception

setFromKey

public void setFromKey(ForeignKey newFromKey)
                throws M4Exception
Setter method.

Parameters:
newFromKey - the new FromKey
Throws:
M4Exception

getFromKey

public ForeignKey getFromKey()
                      throws M4Exception
Getter method.

Returns:
the value
Throws:
M4Exception

removeFromKey

public void removeFromKey()
                   throws M4Exception
Throws:
M4Exception

getCrossLinkColumnSet

public Columnset getCrossLinkColumnSet()
                                throws M4Exception
Returns:
The Columnset that realizes this relation if it is an n:m relation. For 1:n relations, null is returned.
Throws:
M4Exception

setCrossLinkColumnSet

public void setCrossLinkColumnSet(Columnset cs)
                           throws M4Exception
Setter method.

Parameters:
cs - The new cross columnset for the n:m relation.
Throws:
M4Exception

isOneToManyRelation

public boolean isOneToManyRelation()
Returns true iff this Relation models a 1:n relationship.


isManyToManyRelation

public boolean isManyToManyRelation()
Returns true iff this Relation models an n:m relationship.


isRelationallyValid

public boolean isRelationallyValid()
This method returns information about the relational validity of the object. The relational validity is managed at the database level by triggers. The returned value denotes if the object is valid on the relational level or not.


getSubRelations

public java.util.Collection getSubRelations()

getSuperRelation

public Relation getSuperRelation()

setSuperRelation

public void setSuperRelation(Relation superRelationship)
                      throws M4Exception
Throws:
M4Exception

removeSuperRelation

public void removeSuperRelation()
                         throws M4Exception
Remove the link to the superRelationship. The superRelationship itself is not removed.

Throws:
M4Exception

addSubRelationship

public void addSubRelationship(Relation relationship)
                        throws M4Exception
Throws:
M4Exception

getSubRelation

public Relation getSubRelation(java.lang.String name)

getAllSubRelationships

public java.util.Collection getAllSubRelationships()

removeSubRelationship

public void removeSubRelationship(java.lang.String name)
                           throws M4Exception
Throws:
M4Exception

removeAllSubRelationships

public void removeAllSubRelationships()
                               throws M4Exception
Throws:
M4Exception

createCrossLinkColumnset

public Columnset createCrossLinkColumnset(java.lang.String name,
                                          java.lang.String schema,
                                          java.lang.String type)
                                   throws M4Exception
Creates a ColumnSet that will be connected to this Relation. The name of the ColumnSet must be unique for this Relation.

Parameters:
name - The name for the new ColumnSet.
Returns:
The new ColumnSet object.
Throws:
M4Exception - when an error occurs during creation of the object.

removeCrossLinkColumnset

public void removeCrossLinkColumnset()
                              throws M4Exception
Removes the ColumnSet for this Relation. It is also removed from the M4 Schema.

Throws:
M4Exception

setM2mKeys

public void setM2mKeys(ForeignKey fromFK,
                       ForeignKey toFK)
                throws M4Exception
Sets the key fields that define a many-to-many relationship on the relational level for this Relationship. For a many-to-many relationship a ColumnSet and two foreignKeys are needed. The ColumnSet represents the crosstable needed to implement the many-to-many relationship. The crosstable ColumnSet is bound to this Relationship with the createColumnSet method.

The foreignKey of the ColumnSet of the fromConcept is set as the fromKey. The foreignKey of the ColumnSet of the toConcept is set as the toKey.

Parameters:
fromFK - The foreignKey corresponding to the FromConcept.
toFK - The foreignKey corresponding to the ToConcept.
Throws:
StorageException - If key doesn't exist yet, this exception may be propagated from ForeignKey.store().
M4Exception

copy

public Relation copy(Concept fromConcept,
                     Concept toConcept)
              throws M4Exception
Throws:
M4Exception


Copyright © 2001-2005