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

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

public class Columnset
extends M4Data
implements XmlInfo, Columnset

This class represents an M4 Columnset.

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

Field Summary
static java.lang.String ATTRIB_CS_CONCEPT_ID
          Name of the attribute holding the ID reference to the Columnsets' Concept
static java.lang.String ATTRIB_CS_ID
          DB level: Name of the attribute holding Columnset's IDs
static java.lang.String ATTRIB_CS_MSBRANCH
          Name of the attribute with the Columnsets' multi-step information
static java.lang.String ATTRIB_CS_NAME
          Name of the attribute holding the Columnset's names in the relational database
static java.lang.String ATTRIB_CS_SCHEMA
          DB level: Name of the attribute holding the Columnset's database schemas
static java.lang.String ATTRIB_CS_SQL
          Name of the attribute with the Columnsets' SQL definition
static java.lang.String ATTRIB_CS_TYPE
          Name of the attribute holding the type (View or Table) of the Columnsets
static java.lang.String M4_TABLE_NAME
          Name of the M4 table representing Columnsets
static M4Info m4Info
          Cache for getM4Info()
static int MAX_SQLDEF_LENGTH
          The attribute COLUMNSET_T.CS_SQL has a limited length
 
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.Columnset
CS_TYPE_TABLE, CS_TYPE_VIEW, TYPE_MATERIALIZED_VIEW, TYPE_SNAPSHOT, TYPE_TABLE, TYPE_VIEW
 
Fields inherited from interface edu.udo.cs.miningmart.m4.utils.M4Table
NOT_NULL
 
Constructor Summary
Columnset(DB m4Db)
           
 
Method Summary
 void addColumn(Column c)
          Add a column to this columnset's columns.
 void addForeignKey(ForeignKey fk)
          Additional method not in the PSN interface.
 void addMultiStepBranch(java.lang.String branch)
           
 void addMultiStepBranchInfo(java.lang.String oldDef, java.lang.String attribute, java.lang.String value)
          Adds an attribute-value pair to the MultiStepBranch field if the attribute isn't already present there.
 void clearStatistics()
          If data changes in the database, e.g. a DB Concept is edited, then this method allows to delete the deprecated statistics objects without running a garbage collection.
 Columnset copy(Concept newConcept)
          Make a copy of this ColumnSet that is attached to the given Concept.
 Column createColumn(java.lang.String name, java.lang.String datatype)
          Creates a Column that will be connected to this ColumnSet.
 void createColumnsFromDbObject(java.lang.String nameOfTableOrView)
          Creates an M4 Column for every column of the table or view with the given name, and connects it to this Columnset.
 ForeignKey createForeignKeyWhereThisIsFkCs(java.lang.String name)
          Creates a ForeignKey.
 PrimaryKey createPrimaryKey(java.lang.String name)
          Creates a PrimaryKey.
 void deleteSoon()
          Overwrites the superclass method because the columns of this columnset must be deleted, too.
 Column getColumn(int index)
          Get a specific column.
 Column getColumn(java.lang.String name)
           
 java.util.Collection getColumns()
           
 java.lang.String getCompleteSQLQuery()
          This method returns a complete SQL query, which can be used to get the data as represented by this Columnset.
 java.lang.String getCompleteSQLQuery(java.lang.String rowNumName)
          This method returns a complete SQL query, which can be used to get the data as represented by this Columnset.
 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 getForeignKeysWhereThisIsFkCs()
          Active getter for the Key objects referencing to this Columnset as their foreign key.
 java.util.Collection getForeignKeysWhereThisIsPkCs()
          Active getter for the Key objects referencing to this Columnset as their primary key.
 ForeignKey getForeignKeyWhereThisIsFkCs(java.lang.String name)
           
 java.lang.String getIdAttributeName()
           
 M4Info getM4Info()
           
 java.lang.String getM4TableName()
           
 java.lang.String getMsbInfoWithoutAttrib(java.lang.String attributeName)
           
 java.lang.String getMSBranchSelectionValue(java.lang.String attributeName)
          Scans the MultiStepBranch information of the Columnset for attributeName=Value; and returns the corresponding value, null otherwise.
 java.lang.String getMultiStepBranch()
           
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.
 PrimaryKey getPrimaryKey()
           
 Relation getRelation()
          Returns the Relation in which this Columnset realizes the cross table, if there is such a Relation.
 java.lang.String getSchema()
           
 java.lang.String getSchemaPlusName()
           
 java.lang.String getSQLDefinition()
           
 java.util.Collection getStatistics()
          Active getter for the ColumnsetStatistics of this Columnset.
 int getStatisticsAll()
          Active getter method.
 int getStatisticsNominal()
          Getter method.
 int getStatisticsOrdinal()
          Getter method.
 int getStatisticsTime()
          Getter method.
 Concept getTheConcept()
           
 java.lang.String getType()
           
 M4Info getXmlInfo()
           
 boolean hasColumn(Column col)
           
 void primitiveSetConcept(Concept concept)
          Primitive setter, do not use.
 void primitiveSetPrimaryKey(PrimaryKey primKey)
           
 void print()
          Print the information about this Columnset
 java.lang.String readOrComputeCount()
          Reads, or computes and inserts into the statistics table, the number of rows of this ColumnSet and returns it as a string.
 void removeAllColumns()
           
 void removeAllForeignKeys()
          Removes all ForeignKeys from this ColumnSet.
protected  void removeAllM4References()
          This method needs to be implemented by all M4Data objects.
 boolean removeColumn(Column column)
          Remove a column from this Columnsets's columns.
 void removeForeignKeyWhereThisIsFkCs(java.lang.String name)
          Removes the specified ForeignKey for this ColumnSet.
 void removePrimaryKey()
          Removes the specified PrimaryKey for this ColumnSet.
 void setColumn(int index, Column c)
          Set a specific column.
 void setColumns(java.util.Collection theColumns)
          Set all columns of this columnset.
 void setMultiStepBranch(java.lang.String branchDefinition)
          Set the information about the multistep branch.
 void setName(java.lang.String name)
          Do not use spaces in Columnset names, because these names are also used at the DB level.
 void setPrimaryKey(PrimaryKey primKey)
           
 void setRelation(Relation newRelation)
          Sets the connection to a Relation.
 void setRelationPrimitive(Relation r)
          Primitive setter.
 void setSchema(java.lang.String s)
          Set the database schema where the table or view that this columnset refers to lives.
 void setSQLDefinition(java.lang.String sqlDefinition)
          Set the sql definition.
 void setStatistics(java.util.Collection theStats)
          Setter method.
 void setStatisticsAll(int sa)
          Setter method.
 void setStatisticsNominal(int sn)
          Setter method.
 void setStatisticsOrdinal(int so)
          Setter method.
 void setStatisticsTime(int st)
          Setter method.
 void setTheConcept(Concept c)
          Set this columnset's concept.
 void setType(java.lang.String t)
          Set the type of this columnset (table or view).
 void updateStatistics()
          Executes several SQL procedure queries to calculate statistical information for the given columnset on demand.
 
Methods inherited from class edu.udo.cs.miningmart.m4.core.M4Data
deleteLocal, exportLocal, genericGetter, genericSetter, getDocumentation, getObjectsReferencingMe, getObjectsReferencingMe, getObjectTag, getValidName, getXmlIdTag, getXmlVersion, hasDeleteStatus, importLocal, isDirty, isWaitingForDelete, primitiveGetDocObject, primitiveSetDocObject, readFromDb, readFromDbLocal, removeDocObject, removeFromDb, removeSetFromDb, setDirty, setDocumentation, setId, 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
 

Field Detail

M4_TABLE_NAME

public static final java.lang.String M4_TABLE_NAME
Name of the M4 table representing Columnsets

See Also:
Constant Field Values

ATTRIB_CS_ID

public static final java.lang.String ATTRIB_CS_ID
DB level: Name of the attribute holding Columnset's IDs

See Also:
Constant Field Values

ATTRIB_CS_SCHEMA

public static final java.lang.String ATTRIB_CS_SCHEMA
DB level: Name of the attribute holding the Columnset's database schemas

See Also:
Constant Field Values

ATTRIB_CS_NAME

public static final java.lang.String ATTRIB_CS_NAME
Name of the attribute holding the Columnset's names in the relational database

See Also:
Constant Field Values

ATTRIB_CS_TYPE

public static final java.lang.String ATTRIB_CS_TYPE
Name of the attribute holding the type (View or Table) of the Columnsets

See Also:
Constant Field Values

ATTRIB_CS_CONCEPT_ID

public static final java.lang.String ATTRIB_CS_CONCEPT_ID
Name of the attribute holding the ID reference to the Columnsets' Concept

See Also:
Constant Field Values

ATTRIB_CS_MSBRANCH

public static final java.lang.String ATTRIB_CS_MSBRANCH
Name of the attribute with the Columnsets' multi-step information

See Also:
Constant Field Values

ATTRIB_CS_SQL

public static final java.lang.String ATTRIB_CS_SQL
Name of the attribute with the Columnsets' SQL definition

See Also:
Constant Field Values

MAX_SQLDEF_LENGTH

public static final int MAX_SQLDEF_LENGTH
The attribute COLUMNSET_T.CS_SQL has a limited length

See Also:
Constant Field Values

m4Info

public static M4Info m4Info
Cache for getM4Info()

Constructor Detail

Columnset

public Columnset(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()

print

public void print()
Print the information about this Columnset

Specified by:
print in interface M4Object
Specified by:
print in class M4Object

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)

setName

public void setName(java.lang.String name)
Do not use spaces in Columnset names, because these names are also used at the DB level.

Specified by:
setName in interface M4Object
Overrides:
setName in class M4Data
Parameters:
name - the new name to be set
See Also:
M4Object.setName(String)

setTheConcept

public void setTheConcept(Concept c)
                   throws M4Exception
Set this columnset's concept.

Specified by:
setTheConcept in interface Columnset
Parameters:
c - the Concept this ColumnSet belongs to
Throws:
M4Exception

getTheConcept

public Concept getTheConcept()
Specified by:
getTheConcept in interface Columnset
Returns:
the Concept this ColumnSet belongs to

setSchema

public void setSchema(java.lang.String s)
Set the database schema where the table or view that this columnset refers to lives.

Specified by:
setSchema in interface Columnset
Parameters:
s - the schema name

getSchema

public java.lang.String getSchema()
Specified by:
getSchema in interface Columnset
Returns:
the name of the database schema where the table or view that this columnset refers to lives

getSchemaPlusName

public java.lang.String getSchemaPlusName()
Specified by:
getSchemaPlusName in interface Columnset
Returns:
The name only, or "schema"."name" if the "schema" is known.

setType

public void setType(java.lang.String t)
             throws M4Exception
Set the type of this columnset (table or view). Use one of the public constants of this class, either CS_TYPE_TABLE or CS_TYPE_VIEW.

Specified by:
setType in interface Columnset
Parameters:
t - A String constant, either Columnset.CS_TYPE_TABLE or Columnset.CS_TYPE_VIEW
Throws:
M4Exception

getType

public java.lang.String getType()
Specified by:
getType in interface Columnset
Returns:
A String constant, either Columnset.CS_TYPE_TABLE or Columnset.CS_TYPE_VIEW

setSQLDefinition

public void setSQLDefinition(java.lang.String sqlDefinition)
Set the sql definition.

Specified by:
setSQLDefinition in interface Columnset
Parameters:
sqlDefinition - the new definition A value of null indicates that there is no explicit SQL definition, but that the name of the table or view is its defintion at the same time. If the sqlDefinition is null then the method getSQLDefinition() will return getSchemaPlusName().

getSQLDefinition

public java.lang.String getSQLDefinition()
Specified by:
getSQLDefinition in interface Columnset
Returns:
the sql definition of this columnset, if not set explicitly then getSchemaPlusName(). Never returns null.

getCompleteSQLQuery

public java.lang.String getCompleteSQLQuery()
                                     throws M4Exception
This method returns a complete SQL query, which can be used to get the data as represented by this Columnset. In contrast to the method getSQLDefinition() this method does also include virtual columns, which are sometimes not visible at the level of the Columnset's SQL definition.

Specified by:
getCompleteSQLQuery in interface Columnset
Returns:
an SQL string like SELECT <SQLDefinition of Column1> <Name of Column1> , ... <SQLDefinition of Columnn> <Name of Columnn> FROM <SQLDefintion of the Columnset>
Throws:
M4Exception

getCompleteSQLQuery

public java.lang.String getCompleteSQLQuery(java.lang.String rowNumName)
                                     throws M4Exception
This method returns a complete SQL query, which can be used to get the data as represented by this Columnset. The difference to the same method without the additional parameter is, that this method allows to specify a target attribute name for the internal Oracle attribute ROWNUM

Specified by:
getCompleteSQLQuery in interface Columnset
Parameters:
rowNumName - the target attribute name of the ROWNUM attribute
Returns:
an SQL string like SELECT ROWNUM AS <rowNumName>, <SQLDefinition of Column1> <Name of Column1> , ... <SQLDefinition of Columnn> <Name of Columnn> FROM <SQLDefintion of the Columnset>
Throws:
M4Exception
See Also:
Columnset.getCompleteSQLQuery

setMultiStepBranch

public void setMultiStepBranch(java.lang.String branchDefinition)
Set the information about the multistep branch.

Specified by:
setMultiStepBranch in interface Columnset
Parameters:
branchDefinition - The new branch information

getMultiStepBranch

public java.lang.String getMultiStepBranch()
Specified by:
getMultiStepBranch in interface Columnset
Returns:
the information about the multistep branch.

addMultiStepBranchInfo

public void addMultiStepBranchInfo(java.lang.String oldDef,
                                   java.lang.String attribute,
                                   java.lang.String value)
                            throws M4Exception
Adds an attribute-value pair to the MultiStepBranch field if the attribute isn't already present there.

Specified by:
addMultiStepBranchInfo in interface Columnset
Parameters:
oldDef - The multistep branch information so far
attribute - The attribute
Throws:
M4Exception

addMultiStepBranch

public void addMultiStepBranch(java.lang.String branch)
                        throws M4Exception
Specified by:
addMultiStepBranch in interface Columnset
Parameters:
branch - A complete field CS_MSBRANCH as found in table COLUMNSET_T. It is added to the CS_MSBRANCH of this object via addMultiStepBranchInfo.
Throws:
M4Exception

setColumns

public void setColumns(java.util.Collection theColumns)
                throws M4Exception
Set all columns of this columnset.

Specified by:
setColumns in interface Columnset
Parameters:
theColumns - Collection of the new set of column objects
Throws:
M4Exception

setStatistics

public void setStatistics(java.util.Collection theStats)
                   throws M4Exception
Description copied from interface: Columnset
Setter method.

Specified by:
setStatistics in interface Columnset
Throws:
M4Exception

hasColumn

public boolean hasColumn(Column col)
                  throws M4Exception
Specified by:
hasColumn in interface Columnset
Parameters:
col - a Column
Returns:
true if a column with the same ID is already linked to this Columnset
Throws:
M4Exception

getColumns

public java.util.Collection getColumns()
                                throws M4Exception
Specified by:
getColumns in interface Columnset
Returns:
all columns of this columnset in an array
Throws:
M4Exception

setColumn

public void setColumn(int index,
                      Column c)
               throws M4Exception
Set a specific column. This method is to be used with care! At several occasions it is assumed, that each Column is entered just once in a Collection and entering null values might also be problematic!

Specified by:
setColumn in interface Columnset
Parameters:
index - number of the Column
c - Column to be set
Throws:
M4Exception

getColumn

public Column getColumn(int index)
                 throws M4Exception
Get a specific column.

Specified by:
getColumn in interface Columnset
Parameters:
index - number of the Column
Returns:
Column at this index
Throws:
M4Exception

getColumn

public Column getColumn(java.lang.String name)
                 throws M4Exception
Specified by:
getColumn in interface Columnset
Throws:
M4Exception
See Also:
ColumnSet#getColumn(String)

getForeignKeysWhereThisIsFkCs

public java.util.Collection getForeignKeysWhereThisIsFkCs()
                                                   throws M4Exception
Active getter for the Key objects referencing to this Columnset as their foreign key.

Specified by:
getForeignKeysWhereThisIsFkCs in interface Columnset
Returns:
a Collection of Key objects
Throws:
M4Exception

getForeignKeysWhereThisIsPkCs

public java.util.Collection getForeignKeysWhereThisIsPkCs()
                                                   throws M4Exception
Active getter for the Key objects referencing to this Columnset as their primary key.

Returns:
a Collection of Key objects
Throws:
M4Exception

getStatistics

public java.util.Collection getStatistics()
                                   throws M4Exception
Active getter for the ColumnsetStatistics of this Columnset.

Specified by:
getStatistics in interface Columnset
Returns:
a Collection of ColumnsetStatistics objects, never null.
Throws:
M4Exception

setStatisticsAll

public void setStatisticsAll(int sa)
                      throws M4Exception
Setter method.

Specified by:
setStatisticsAll in interface Columnset
Parameters:
sa - the new value
Throws:
M4Exception

getStatisticsAll

public int getStatisticsAll()
                     throws M4Exception
Active getter method.

Specified by:
getStatisticsAll in interface Columnset
Returns:
the value
Throws:
M4Exception

setStatisticsNominal

public void setStatisticsNominal(int sn)
                          throws M4Exception
Setter method.

Specified by:
setStatisticsNominal in interface Columnset
Parameters:
sn - the new value
Throws:
M4Exception

getStatisticsNominal

public int getStatisticsNominal()
                         throws M4Exception
Getter method.

Specified by:
getStatisticsNominal in interface Columnset
Returns:
the value
Throws:
M4Exception

setStatisticsOrdinal

public void setStatisticsOrdinal(int so)
                          throws M4Exception
Setter method.

Specified by:
setStatisticsOrdinal in interface Columnset
Parameters:
so - the new value
Throws:
M4Exception

getStatisticsOrdinal

public int getStatisticsOrdinal()
                         throws M4Exception
Getter method.

Specified by:
getStatisticsOrdinal in interface Columnset
Returns:
the value
Throws:
M4Exception

setStatisticsTime

public void setStatisticsTime(int st)
                       throws M4Exception
Setter method.

Specified by:
setStatisticsTime in interface Columnset
Parameters:
st - the new value
Throws:
M4Exception

getStatisticsTime

public int getStatisticsTime()
                      throws M4Exception
Getter method.

Specified by:
getStatisticsTime in interface Columnset
Returns:
the value
Throws:
M4Exception

addColumn

public void addColumn(Column c)
               throws M4Exception
Add a column to this columnset's columns.

Specified by:
addColumn in interface Columnset
Parameters:
c - the additional column
Throws:
M4Exception

removeColumn

public boolean removeColumn(Column column)
                     throws M4Exception
Remove a column from this Columnsets's columns.

Specified by:
removeColumn in interface Columnset
Returns:
true if removing succeeded
Throws:
M4Exception

getMSBranchSelectionValue

public java.lang.String getMSBranchSelectionValue(java.lang.String attributeName)
                                           throws M4Exception
Scans the MultiStepBranch information of the Columnset for attributeName=Value; and returns the corresponding value, null otherwise. The attribute name is compared in a case insensitive way and it is assumed that exactly the format above is used. Each attribute value pair needs to be terminated by a ';', no whitespaces in between! If this assumption does not hold parsing might throw an exception.

Specified by:
getMSBranchSelectionValue in interface Columnset
Parameters:
attributeName - The name of the BaseAttribute or pseudo-attribute (e.g. (Random)) for which the value should be read from the CS_MSBRANCH field.
Returns:
the value, if found, null otherwise.
Throws:
M4Exception

getMsbInfoWithoutAttrib

public java.lang.String getMsbInfoWithoutAttrib(java.lang.String attributeName)
                                         throws M4Exception
Specified by:
getMsbInfoWithoutAttrib in interface Columnset
Returns:
the MultiStepBranch-String omitting the equation for the given attribute. If the attribute does not occur, the complete String is returned. Note that an attribute is expected to occur at most once in the MultiStepBranch-String, because multiple occurences are redundant or result in an empty Columnset.
Throws:
M4Exception, - if the attributeName occurs in the String, but the substring is not properly ended by the character ';'.
M4Exception

readOrComputeCount

public java.lang.String readOrComputeCount()
                                    throws M4Exception
Reads, or computes and inserts into the statistics table, the number of rows of this ColumnSet and returns it as a string.

Specified by:
readOrComputeCount in interface Columnset
Returns:
the number of rows in the columnset as a String
Throws:
M4Exception

updateStatistics

public void updateStatistics()
                      throws M4Exception
Executes several SQL procedure queries to calculate statistical information for the given columnset on demand. The result is written to the table CSSTATIST_T and the JAVA cache is updated. Statistics already available are not recomputed. Finally an update for the statistics of all the Columns of this Columnset is performed.

Specified by:
updateStatistics in interface Columnset
Throws:
M4Exception

clearStatistics

public void clearStatistics()
                     throws M4Exception
If data changes in the database, e.g. a DB Concept is edited, then this method allows to delete the deprecated statistics objects without running a garbage collection.

Specified by:
clearStatistics in interface Columnset
Throws:
M4Exception

primitiveSetConcept

public void primitiveSetConcept(Concept concept)
Primitive setter, do not use.

Parameters:
concept - the Concept to be set

deleteSoon

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

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

getRelation

public Relation getRelation()
Returns the Relation in which this Columnset realizes the cross table, if there is such a Relation.

Specified by:
getRelation in interface Columnset
Returns:
Relation The Relation or null

setRelation

public void setRelation(Relation newRelation)
                 throws M4Exception
Sets the connection to a Relation. This can be used if this Columnset realizes the cross table of a Relation.

Specified by:
setRelation in interface Columnset
Parameters:
newRelation - The Relation to set
Throws:
M4Exception

setRelationPrimitive

public void setRelationPrimitive(Relation r)
Primitive setter. Do not use!


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()

createColumn

public Column createColumn(java.lang.String name,
                           java.lang.String datatype)
                    throws M4Exception
Description copied from interface: Columnset
Creates a Column that will be connected to this ColumnSet. The name of the Column must be unique for this ColumnSet.

Specified by:
createColumn in interface Columnset
Throws:
M4Exception
See Also:
ColumnSet#createColumn(String, String)

createColumnsFromDbObject

public void createColumnsFromDbObject(java.lang.String nameOfTableOrView)
                               throws M4Exception
Description copied from interface: Columnset
Creates an M4 Column for every column of the table or view with the given name, and connects it to this Columnset.

Specified by:
createColumnsFromDbObject in interface Columnset
Parameters:
nameOfTableOrView - name of the table or view
Throws:
M4Exception

copy

public Columnset copy(Concept newConcept)
               throws M4Exception
Make a copy of this ColumnSet that is attached to the given Concept.

Specified by:
copy in interface Columnset
Throws:
M4Exception
See Also:
ColumnSet#copy(Concept)

createForeignKeyWhereThisIsFkCs

public ForeignKey createForeignKeyWhereThisIsFkCs(java.lang.String name)
                                           throws M4Exception
Description copied from interface: Columnset
Creates a ForeignKey. The name of the Key must be unique within the ColumnSet.

Specified by:
createForeignKeyWhereThisIsFkCs in interface Columnset
Throws:
M4Exception
See Also:
ColumnSet#createForeignKey(String)

getForeignKeyWhereThisIsFkCs

public ForeignKey getForeignKeyWhereThisIsFkCs(java.lang.String name)
                                        throws M4Exception
Specified by:
getForeignKeyWhereThisIsFkCs in interface Columnset
Throws:
M4Exception
See Also:
ColumnSet#getForeignKey(String)

addForeignKey

public void addForeignKey(ForeignKey fk)
                   throws M4Exception
Additional method not in the PSN interface.

Throws:
M4Exception

removeForeignKeyWhereThisIsFkCs

public void removeForeignKeyWhereThisIsFkCs(java.lang.String name)
                                     throws M4Exception
Description copied from interface: Columnset
Removes the specified ForeignKey for this ColumnSet. It is also removed from the M4 Schema.

Specified by:
removeForeignKeyWhereThisIsFkCs in interface Columnset
Throws:
M4Exception
See Also:
ColumnSet#removeForeignKey(String)

removeAllForeignKeys

public void removeAllForeignKeys()
                          throws M4Exception
Description copied from interface: Columnset
Removes all ForeignKeys from this ColumnSet. They are removed from the M4 Schema.

Specified by:
removeAllForeignKeys in interface Columnset
Throws:
M4Exception
See Also:
ColumnSet#removeAllForeignKeys()

createPrimaryKey

public PrimaryKey createPrimaryKey(java.lang.String name)
                            throws M4Exception
Description copied from interface: Columnset
Creates a PrimaryKey. The name of the Key must be unique within the ColumnSet.

Specified by:
createPrimaryKey in interface Columnset
Throws:
M4Exception
See Also:
ColumnSet#createPrimaryKey(String)

removeAllColumns

public void removeAllColumns()
                      throws M4Exception
Specified by:
removeAllColumns in interface Columnset
Throws:
M4Exception

getPrimaryKey

public PrimaryKey getPrimaryKey()
                         throws M4Exception
Specified by:
getPrimaryKey in interface Columnset
Throws:
M4Exception
See Also:
ColumnSet#getPrimaryKey()

primitiveSetPrimaryKey

public void primitiveSetPrimaryKey(PrimaryKey primKey)
See Also:
ColumnSet#setPrimaryKey(PrimaryKey)

setPrimaryKey

public void setPrimaryKey(PrimaryKey primKey)
                   throws M4Exception
Specified by:
setPrimaryKey in interface Columnset
Throws:
M4Exception

removePrimaryKey

public void removePrimaryKey()
                      throws M4Exception
Description copied from interface: Columnset
Removes the specified PrimaryKey for this ColumnSet. It is also removed from the M4 Schema.

Specified by:
removePrimaryKey in interface Columnset
Throws:
M4Exception
See Also:
ColumnSet#removePrimaryKey()


Copyright © 2001-2005