edu.udo.cs.miningmart.m4
Interface M4Object

All Known Subinterfaces:
Assertion, BaseAttribute, Case, Chain, Column, Columnset, ColumnsetStatistics, ColumnStatistics1, ColumnStatistics2, Concept, Condition, Constraint, Docu, Feature, ForeignKey, GraphicalM4Object, Key, M4Data, MultiColumnFeature, Operator, OpParam, Parameter, ParameterObject, PrimaryKey, Projection, Relation, Step, Value
All Known Implementing Classes:
Assertion, BaseAttribute, Case, Chain, Column, Columnset, ColumnsetStatistics, ColumnStatistics1, ColumnStatistics2, Concept, Condition, Constraint, Docu, Feature, ForeignKey, GraphicalM4Object, Key, M4Object, MultiColumnFeature, Operator, OpParam, Parameter, ParameterObject, PrimaryKey, Projection, Relation, Step, Value

public interface M4Object

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

Method Summary
 void doPrint(java.lang.Exception ex)
          Method to print exception messages to the screen or log file.
 void doPrint(java.util.logging.Level verbosity, java.lang.String printString)
          Method to print messages to the screen or log file.
 boolean equals(java.lang.Object obj)
          Two M4Objects are defined to be equal, if they refer to the same object.
 java.lang.String executeBusinessSingleValueSqlRead(java.lang.String query)
           
 java.lang.Long executeBusinessSingleValueSqlReadL(java.lang.String query)
           
 java.sql.ResultSet executeBusinessSqlRead(java.lang.String query)
          Method to comfortably read from the business database.
 void executeBusinessSqlWrite(java.lang.String query)
          Method to comfortably write to the business database.
 java.lang.String executeM4SingleValueSqlRead(java.lang.String query)
           
 java.lang.Long executeM4SingleValueSqlReadL(java.lang.String query)
           
 java.sql.ResultSet executeM4SqlRead(java.lang.String query)
          Method to comfortably read from the M4 database.
 void executeM4SqlWrite(java.lang.String query)
          Method to comfortably write to the M4 database.
 Print getCasePrintObject()
           
 long getId()
          Returns id for this object.
 DB getM4Db()
          Get the DB Object
 M4Object getM4ObjectFromCache(long Id)
          This method returns the object with the given Id if it is in the Cache.
 java.lang.String getName()
          Get the name for this object.
 long getNextM4SequenceValue()
           
 boolean isNew()
          Check for M4Object if it was newly created by the user, or if it is already in the database.
 M4Object load(long id)
          Load the M4 object with the given ID.
 void print()
          Method to print data about this M4Object.
 void putM4ObjectToCache(M4Object m4o)
          This method stores an M4 object in the Cache, using its ID as the key for the underlying data structure.
 java.lang.String replaceSpacesInName(java.lang.String name)
          Service method for M4Object names that are also used as DB names.
 void setId(long id)
          Sets id for this object.
 void setName(java.lang.String name)
          Set the name for this object.
 

Method Detail

getM4Db

public DB getM4Db()
Get the DB Object


load

public M4Object load(long id)
              throws M4Exception
Load the M4 object with the given ID.

Throws:
M4Exception

getCasePrintObject

public Print getCasePrintObject()

doPrint

public void doPrint(java.util.logging.Level verbosity,
                    java.lang.String printString)
Method to print messages to the screen or log file.

Parameters:
verbosity - A verbosity level. Use one of the public static variables of the class Print.
printString - The string with the message.
See Also:
edu.udo.cs.miningmart.m4.core.utils.Print

doPrint

public void doPrint(java.lang.Exception ex)
Method to print exception messages to the screen or log file.

Parameters:
ex - An exception object. Its message string will be printed.

print

public void print()
Method to print data about this M4Object.


getId

public long getId()
Returns id for this object.


setId

public void setId(long id)
           throws M4Exception
Sets id for this object.

Throws:
M4Exception

getName

public java.lang.String getName()
Get the name for this object.


setName

public void setName(java.lang.String name)
Set the name for this object.


replaceSpacesInName

public java.lang.String replaceSpacesInName(java.lang.String name)
Service method for M4Object names that are also used as DB names.

Parameters:
name - the original name for an M4 object (or null)
Returns:
the specified name with all spaces replaced by underscores (or null)

isNew

public boolean isNew()
Check for M4Object if it was newly created by the user, or if it is already in the database.


getM4ObjectFromCache

public M4Object getM4ObjectFromCache(long Id)
This method returns the object with the given Id if it is in the Cache.

Parameters:
Id - The unique M4 Id of the object to be loaded.

putM4ObjectToCache

public void putM4ObjectToCache(M4Object m4o)
                        throws M4Exception
This method stores an M4 object in the Cache, using its ID as the key for the underlying data structure.

Throws:
M4Exception

executeM4SqlWrite

public void executeM4SqlWrite(java.lang.String query)
                       throws M4Exception
Method to comfortably write to the M4 database.

Parameters:
query - an SQL query to be executed. This has to be a write operation to the M4 database, or an SQL string to execute a procedure in the M4 schema.
Throws:
M4Exception

executeBusinessSqlWrite

public void executeBusinessSqlWrite(java.lang.String query)
                             throws M4Exception
Method to comfortably write to the business database.

Parameters:
query - an SQL query to be executed. This has to be a write operation to the business database, or an SQL string to execute a procedure in the business schema.
Throws:
M4Exception

executeM4SqlRead

public java.sql.ResultSet executeM4SqlRead(java.lang.String query)
                                    throws M4Exception
Method to comfortably read from the M4 database. The caller has to close the returned ResultSet after usage!

Parameters:
query - an SQL query to be executed. This has to be a read operation on the M4 database.
Throws:
M4Exception

executeBusinessSqlRead

public java.sql.ResultSet executeBusinessSqlRead(java.lang.String query)
                                          throws M4Exception
Method to comfortably read from the business database. The caller has to close the returned ResultSet after usage!

Parameters:
query - an SQL query to be executed. This has to be a read operation on the business database.
Throws:
M4Exception

executeM4SingleValueSqlReadL

public java.lang.Long executeM4SingleValueSqlReadL(java.lang.String query)
                                            throws M4Exception
Throws:
M4Exception

executeBusinessSingleValueSqlReadL

public java.lang.Long executeBusinessSingleValueSqlReadL(java.lang.String query)
                                                  throws M4Exception
Throws:
M4Exception

executeM4SingleValueSqlRead

public java.lang.String executeM4SingleValueSqlRead(java.lang.String query)
                                             throws M4Exception
Throws:
M4Exception

executeBusinessSingleValueSqlRead

public java.lang.String executeBusinessSingleValueSqlRead(java.lang.String query)
                                                   throws M4Exception
Throws:
M4Exception

getNextM4SequenceValue

public long getNextM4SequenceValue()
                            throws M4Exception
Throws:
M4Exception

equals

public boolean equals(java.lang.Object obj)
Two M4Objects are defined to be equal, if they refer to the same object. This is true, if their ID is the same.



Copyright © 2001-2005