|
|||||||||
| 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.Columnset
public class Columnset
This class represents an M4 Columnset.
| 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, THRESHOLD_FOR_SAMPLING, 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 |
getConnectableColumns()
This method returns a collection of Column objects, which represent the columns of the database table or view that is 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. |
long |
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(long 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). |
boolean |
statisticsExist()
Checks if any statistics for this columnset have been computed. |
void |
updateStatistics()
Executes several SQL procedure queries to calculate statistical information for the given columnset on demand. |
void |
updateStatisticsBasedOnSample(long sampleSize)
Similar to updateStatistics, but it uses a sample of the
data of this Columnset to determine the statistics. |
| Methods inherited from class edu.udo.cs.miningmart.m4.core.M4Data |
|---|
deleteLocal, 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, 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.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, setNotNew |
| Field Detail |
|---|
public static final java.lang.String M4_TABLE_NAME
Columnsets
public static final java.lang.String ATTRIB_CS_ID
Columnset's IDs
public static final java.lang.String ATTRIB_CS_SCHEMA
Columnset's database schemas
public static final java.lang.String ATTRIB_CS_NAME
Columnset's names in the relational database
public static final java.lang.String ATTRIB_CS_TYPE
Columnsets
public static final java.lang.String ATTRIB_CS_CONCEPT_ID
public static final java.lang.String ATTRIB_CS_MSBRANCH
Columnsets' multi-step information
public static final java.lang.String ATTRIB_CS_SQL
Columnsets' SQL definition
public static final int MAX_SQLDEF_LENGTH
public static M4Info m4Info
| Constructor Detail |
|---|
public Columnset(DB m4Db)
edu.udo.cs.miningmart.m4.core.M4Data#Constructor| Method Detail |
|---|
public java.lang.String getM4TableName()
getM4TableName in interface M4TableM4Table.getM4TableName()public java.lang.String getIdAttributeName()
getIdAttributeName in interface M4TableM4Table.getIdAttributeName()public M4Info getM4Info()
getM4Info in interface M4TableM4Table.getM4Info()public M4Info getXmlInfo()
getXmlInfo in interface XmlInfoM4Info object with the information
of all XML fields of this object.XmlInfo.getXmlInfo()public void print()
print in interface M4Objectprint in class M4Object
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)public void setName(java.lang.String name)
setName in interface M4ObjectsetName in class M4Dataname - the new name to be setM4Object.setName(String)
public void setTheConcept(Concept c)
throws M4Exception
setTheConcept in interface Columnsetc - the Concept this ColumnSet belongs to
M4Exceptionpublic Concept getTheConcept()
getTheConcept in interface Columnsetpublic void setSchema(java.lang.String s)
setSchema in interface Columnsets - the schema namepublic java.lang.String getSchema()
getSchema in interface Columnsetpublic java.lang.String getSchemaPlusName()
getSchemaPlusName in interface Columnset
public void setType(java.lang.String t)
throws M4Exception
setType in interface Columnsett - A String constant, either Columnset.CS_TYPE_TABLE or Columnset.CS_TYPE_VIEW
M4Exceptionpublic java.lang.String getType()
getType in interface Columnsetpublic void setSQLDefinition(java.lang.String sqlDefinition)
setSQLDefinition in interface ColumnsetsqlDefinition - 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().public java.lang.String getSQLDefinition()
getSQLDefinition in interface ColumnsetgetSchemaPlusName(). Never returns null.
public java.lang.String getCompleteSQLQuery()
throws M4Exception
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.
getCompleteSQLQuery in interface ColumnsetM4Exception
public java.lang.String getCompleteSQLQuery(java.lang.String rowNumName)
throws M4Exception
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
getCompleteSQLQuery in interface ColumnsetrowNumName - the target attribute name of the ROWNUM attribute
M4ExceptionColumnset.getCompleteSQLQuerypublic void setMultiStepBranch(java.lang.String branchDefinition)
setMultiStepBranch in interface ColumnsetbranchDefinition - The new branch informationpublic java.lang.String getMultiStepBranch()
getMultiStepBranch in interface Columnset
public void addMultiStepBranchInfo(java.lang.String oldDef,
java.lang.String attribute,
java.lang.String value)
throws M4Exception
addMultiStepBranchInfo in interface ColumnsetoldDef - The multistep branch information so farattribute - The attributethe - value for the attribute
M4Exception
public void addMultiStepBranch(java.lang.String branch)
throws M4Exception
addMultiStepBranch in interface Columnsetbranch - A complete field CS_MSBRANCH as found in table
COLUMNSET_T. It is added to the CS_MSBRANCH of this
object via addMultiStepBranchInfo.
M4Exception
public void setColumns(java.util.Collection theColumns)
throws M4Exception
setColumns in interface ColumnsettheColumns - Collection of the new set of column objects
M4Exception
public void setStatistics(java.util.Collection theStats)
throws M4Exception
Columnset
setStatistics in interface ColumnsetM4Exception
public boolean hasColumn(Column col)
throws M4Exception
hasColumn in interface Columnsetcol - a Column
true if a column with the same ID is already linked to this
Columnset
M4Exception
public java.util.Collection getColumns()
throws M4Exception
getColumns in interface ColumnsetM4Exception
public java.util.Collection getConnectableColumns()
throws M4Exception
getConnectableColumns in interface ColumnsetM4Exception
public void setColumn(int index,
Column c)
throws M4Exception
null values might also be
problematic!
setColumn in interface Columnsetindex - number of the Columnc - Column to be set
M4Exception
public Column getColumn(int index)
throws M4Exception
getColumn in interface Columnsetindex - number of the Column
M4Exception
public Column getColumn(java.lang.String name)
throws M4Exception
getColumn in interface ColumnsetM4ExceptionColumnSet#getColumn(String)
public java.util.Collection getForeignKeysWhereThisIsFkCs()
throws M4Exception
Key objects referencing to this
Columnset as their foreign key.
getForeignKeysWhereThisIsFkCs in interface ColumnsetCollection of Key objects
M4Exception
public java.util.Collection getForeignKeysWhereThisIsPkCs()
throws M4Exception
Key objects referencing to this
Columnset as their primary key.
Collection of Key objects
M4Exception
public java.util.Collection getStatistics()
throws M4Exception
ColumnsetStatistics of this Columnset.
getStatistics in interface ColumnsetCollection of ColumnsetStatistics objects, never
null.
M4Exception
public void setStatisticsAll(long sa)
throws M4Exception
setStatisticsAll in interface Columnsetsa - the new value
M4Exception
public long getStatisticsAll()
throws M4Exception
getStatisticsAll in interface ColumnsetM4Exception
public void setStatisticsNominal(int sn)
throws M4Exception
setStatisticsNominal in interface Columnsetsn - the new value
M4Exception
public int getStatisticsNominal()
throws M4Exception
getStatisticsNominal in interface ColumnsetM4Exception
public void setStatisticsOrdinal(int so)
throws M4Exception
setStatisticsOrdinal in interface Columnsetso - the new value
M4Exception
public int getStatisticsOrdinal()
throws M4Exception
getStatisticsOrdinal in interface ColumnsetM4Exception
public void setStatisticsTime(int st)
throws M4Exception
setStatisticsTime in interface Columnsetst - the new value
M4Exception
public int getStatisticsTime()
throws M4Exception
getStatisticsTime in interface ColumnsetM4Exception
public void addColumn(Column c)
throws M4Exception
addColumn in interface Columnsetc - the additional column
M4Exception
public boolean removeColumn(Column column)
throws M4Exception
removeColumn in interface Columnsetc - The new column.
true if removing succeeded
M4Exception
public java.lang.String getMSBranchSelectionValue(java.lang.String attributeName)
throws M4Exception
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.
getMSBranchSelectionValue in interface ColumnsetattributeName - The name of the BaseAttribute or
pseudo-attribute (e.g. (Random)) for which the value should
be read from the CS_MSBRANCH field.
null otherwise.
M4Exception
public java.lang.String getMsbInfoWithoutAttrib(java.lang.String attributeName)
throws M4Exception
getMsbInfoWithoutAttrib in interface Columnsetattributename - The name of a BaseAttribute or a pseudoattribute
which potentially occurs in the MultiStepBranch information attached to the
Columnset.
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.
M4Exception, - if the attributeName occurs in the
String, but the substring is not properly ended by the character ';'.
M4Exception
public java.lang.String readOrComputeCount()
throws M4Exception
readOrComputeCount in interface ColumnsetM4Exception
public void updateStatistics()
throws M4Exception
Columns of this
Columnset is performed.
updateStatistics in interface ColumnsetM4Exception
public void updateStatisticsBasedOnSample(long sampleSize)
throws M4Exception
ColumnsetupdateStatistics, but it uses a sample of the
data of this Columnset to determine the statistics. This is done to
speed up the computation of statistics, if exact statistics are not
needed.
updateStatisticsBasedOnSample in interface ColumnsetsampleSize - the maximum size of the sample to be used
M4Exception
public boolean statisticsExist()
throws M4Exception
Columnset
statisticsExist in interface ColumnsetM4Exception
public void clearStatistics()
throws M4Exception
clearStatistics in interface ColumnsetM4Exceptionpublic void primitiveSetConcept(Concept concept)
concept - the Concept to be set
public void deleteSoon()
throws M4Exception
deleteSoon in interface M4DatadeleteSoon in class M4DataM4Exception
public Relation getRelation()
throws M4Exception
getRelation in interface Columnsetnull
M4Exception
public void setRelation(Relation newRelation)
throws M4Exception
setRelation in interface ColumnsetnewRelation - The Relation to set
M4Exceptionpublic void setRelationPrimitive(Relation r)
protected void removeAllM4References()
throws M4Exception
M4DataM4Data
objects. It has to remove all references to other
M4Objects.
removeAllM4References in class M4DataM4ExceptionM4Data.removeAllM4References()
public java.util.Collection getDependentObjects()
throws M4Exception
M4DataM4Data sub-classes that need to be serialized.
getDependentObjects in interface XmlInfogetDependentObjects in class M4DataCollection of all M4Data Java objects
holding a foreign key reference to this object.
This method must never return null.
M4ExceptionM4Data.getDependentObjects()
public Column createColumn(java.lang.String name,
java.lang.String datatype)
throws M4Exception
Columnset
createColumn in interface ColumnsetM4ExceptionColumnSet#createColumn(String, String)
public void createColumnsFromDbObject(java.lang.String nameOfTableOrView)
throws M4Exception
Columnset
createColumnsFromDbObject in interface ColumnsetnameOfTableOrView - name of the table or view
M4Exception
public Columnset copy(Concept newConcept)
throws M4Exception
copy in interface ColumnsetM4ExceptionColumnSet#copy(Concept)
public ForeignKey createForeignKeyWhereThisIsFkCs(java.lang.String name)
throws M4Exception
Columnset
createForeignKeyWhereThisIsFkCs in interface ColumnsetM4ExceptionColumnSet#createForeignKey(String)
public ForeignKey getForeignKeyWhereThisIsFkCs(java.lang.String name)
throws M4Exception
getForeignKeyWhereThisIsFkCs in interface ColumnsetM4ExceptionColumnSet#getForeignKey(String)
public void addForeignKey(ForeignKey fk)
throws M4Exception
M4Exception
public void removeForeignKeyWhereThisIsFkCs(java.lang.String name)
throws M4Exception
Columnset
removeForeignKeyWhereThisIsFkCs in interface ColumnsetM4ExceptionColumnSet#removeForeignKey(String)
public void removeAllForeignKeys()
throws M4Exception
Columnset
removeAllForeignKeys in interface ColumnsetM4ExceptionColumnSet#removeAllForeignKeys()
public PrimaryKey createPrimaryKey(java.lang.String name)
throws M4Exception
Columnset
createPrimaryKey in interface ColumnsetM4ExceptionColumnSet#createPrimaryKey(String)
public void removeAllColumns()
throws M4Exception
removeAllColumns in interface ColumnsetM4Exception
public PrimaryKey getPrimaryKey()
throws M4Exception
getPrimaryKey in interface ColumnsetM4ExceptionColumnSet#getPrimaryKey()public void primitiveSetPrimaryKey(PrimaryKey primKey)
ColumnSet#setPrimaryKey(PrimaryKey)
public void setPrimaryKey(PrimaryKey primKey)
throws M4Exception
setPrimaryKey in interface ColumnsetM4Exception
public void removePrimaryKey()
throws M4Exception
Columnset
removePrimaryKey in interface ColumnsetM4ExceptionColumnSet#removePrimaryKey()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||