|
||||||||||
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
The super class for all M4 objects. All M4 objects have a unique ID and a reference to the DB object that is used in the current compiler thread. Thus there are setter and getter methods for them in this class.
M4Data
,
Operator
,
Serialized FormField Summary | |
protected long |
myId
|
protected java.lang.String |
myName
|
Constructor Summary | |
M4Object(DB db)
|
Method Summary | |
int |
compareTo(java.lang.Object anM4Object)
|
void |
doPrint(java.lang.Exception ex)
Method to be used by all subclasses to print exception messages to the screen or log file. |
void |
doPrint(java.util.logging.Level verbosity,
java.lang.String printString)
Method to be used by all subclasses to print messages to the screen or log file. |
boolean |
equals(java.lang.Object obj)
Two M4Object s 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()
Get the Id. |
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 of this M4 object. |
long |
getNextM4SequenceValue()
|
boolean |
isNew()
Check if this object 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. |
abstract void |
print()
Print this M4 object's parameters. |
void |
putM4ObjectToCache(M4Object m4o)
This method stores an M4 object in the Cache, using its ID as the key for the underlying data structure. |
abstract void |
readFromDb()
Must be implemented by all subclasses. |
java.lang.String |
replaceSpacesInName(java.lang.String name)
Service method for M4Object names that are also used as DB names. |
void |
setId(long newId)
Only use this method if you know what you are doing. |
void |
setName(java.lang.String n)
Set the name of this M4 object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String myName
protected long myId
Constructor Detail |
public M4Object(DB db)
Method Detail |
public Print getCasePrintObject()
getCasePrintObject
in interface M4Object
public M4Object load(long id) throws M4Exception
M4Object
load
in interface M4Object
M4Exception
public abstract void readFromDb() throws M4Exception
M4Exception
public abstract void print()
print
in interface M4Object
public long getId()
getId
in interface M4Object
public void setId(long newId) throws M4Exception
setId
in interface M4Object
newId
- The new id for this M4 object.
M4Exception
public DB getM4Db()
getM4Db
in interface M4Object
edu.udo.cs.miningmart.m4.core.utils.DB
public void doPrint(java.util.logging.Level verbosity, java.lang.String printString)
doPrint
in interface M4Object
verbosity
- A verbosity level. Use one of the public
static variables of the class Print
.printString
- The string with the message.edu.udo.cs.miningmart.m4.core.utils.Print
public void doPrint(java.lang.Exception ex)
doPrint
in interface M4Object
ex
- An exception object. Its message string will be printed.public void setName(java.lang.String n)
setName
in interface M4Object
n
- The new name.public java.lang.String replaceSpacesInName(java.lang.String name)
replaceSpacesInName
in interface M4Object
name
- the original name for an M4 object (or null
)
null
)public java.lang.String getName()
getName
in interface M4Object
public boolean isNew()
isNew
in interface M4Object
public M4Object getM4ObjectFromCache(long Id)
getM4ObjectFromCache
in interface M4Object
Id
- The unique M4 Id of the object to be loaded.
null
otherwise.public void putM4ObjectToCache(M4Object m4o) throws M4Exception
putM4ObjectToCache
in interface M4Object
M4CompilerError
- if the object is null
or
has an ID of 0.
M4Exception
public void executeM4SqlWrite(java.lang.String query) throws M4Exception
executeM4SqlWrite
in interface M4Object
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.
M4Exception
public void executeBusinessSqlWrite(java.lang.String query) throws M4Exception
executeBusinessSqlWrite
in interface M4Object
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.
M4Exception
public java.sql.ResultSet executeM4SqlRead(java.lang.String query) throws M4Exception
ResultSet
after usage!
executeM4SqlRead
in interface M4Object
query
- an SQL query to be executed. This has to be a read operation on the M4 database.
ResultSet
M4Exception
public java.sql.ResultSet executeBusinessSqlRead(java.lang.String query) throws M4Exception
ResultSet
after usage!
executeBusinessSqlRead
in interface M4Object
query
- an SQL query to be executed. This has to be a read operation on the business database.
ResultSet
M4Exception
public java.lang.Long executeM4SingleValueSqlReadL(java.lang.String query) throws M4Exception
executeM4SingleValueSqlReadL
in interface M4Object
M4Exception
In contrast to that method, this method creates and then closes its own
Statement
.
public java.lang.Long executeBusinessSingleValueSqlReadL(java.lang.String query) throws M4Exception
executeBusinessSingleValueSqlReadL
in interface M4Object
M4Exception
In contrast to that method, this method creates and then closes its own
Statement
.
public java.lang.String executeM4SingleValueSqlRead(java.lang.String query) throws M4Exception
executeM4SingleValueSqlRead
in interface M4Object
M4Exception
In contrast to that method, this method creates and then closes its own
Statement
.
public java.lang.String executeBusinessSingleValueSqlRead(java.lang.String query) throws M4Exception
executeBusinessSingleValueSqlRead
in interface M4Object
M4Exception
In contrast to that method, this method creates and then closes its own
Statement
.
public long getNextM4SequenceValue() throws M4Exception
getNextM4SequenceValue
in interface M4Object
M4CompilerError
- if for some reason the sequence does not return a value
M4Exception
public boolean equals(java.lang.Object obj)
M4Object
s are defined to be equal, if they refer to the
same object. This is true, if their ID is the same.
equals
in interface M4Object
obj
- an Object
to compare this object with.
true
iff obj is an M4Object
with the
same ID, or if both IDs are 0 then also with the same name.public int compareTo(java.lang.Object anM4Object) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
java.lang.ClassCastException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |