|
Ontimize 5.2072EN | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
com.ontimize.db.TableEntity
com.ontimize.db.CacheTableEntity
Implementation for an entity with cache. By the moment the query method not
accept SearchValue.
Title:
Description:
Copyright: Copyright (c) 2003
Company:
| Nested Class Summary |
| Nested classes inherited from class com.ontimize.db.TableEntity |
TableEntity.AttachmentReceiving, TableEntity.Receiving |
| Field Summary | |
protected EntityResult |
data
|
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
| Constructor Summary | |
CacheTableEntity(EntityReferenceLocator referenceLocator,
DatabaseConnectionManager connectionManager,
int port)
|
|
| Method Summary | |
protected abstract void |
dataDeleted(java.util.Hashtable kv)
|
protected abstract void |
dataInserted(java.util.Hashtable av)
|
protected abstract void |
dataUpdated(java.util.Hashtable kv)
|
EntityResult |
delete(java.util.Hashtable keys,
int sessionId)
This method must implement a standard delete operation over the set of records defined by keysValues. |
protected void |
initData()
|
EntityResult |
insert(java.util.Hashtable values,
int sessionId)
This method implements a standard database insert operation with the data contained in attributesValues parameter. |
EntityResult |
query(java.util.Hashtable keysValues,
java.util.Vector attributes,
int sessionId)
This method implements a standard query operation returning the set of data that matches the conditions specified by the keysValues
parameter. |
AdvancedEntityResult |
query(java.util.Hashtable keysValues,
java.util.Vector attributes,
int currentIndex,
int number,
java.lang.String orderBy,
int sessionId)
|
EntityResult |
update(java.util.Hashtable values,
java.util.Hashtable keys,
int sessionId)
This method implements a standard update operation with the data specified in attributesValues over the set of records defined by
keysValues. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected EntityResult data
| Constructor Detail |
public CacheTableEntity(EntityReferenceLocator referenceLocator,
DatabaseConnectionManager connectionManager,
int port)
throws java.lang.Exception
| Method Detail |
protected void initData()
public AdvancedEntityResult query(java.util.Hashtable keysValues,
java.util.Vector attributes,
int currentIndex,
int number,
java.lang.String orderBy,
int sessionId)
throws java.lang.Exception
java.lang.Exception
public EntityResult query(java.util.Hashtable keysValues,
java.util.Vector attributes,
int sessionId)
throws java.lang.Exception
TableEntitykeysValues
parameter. The attributes defines which attributes (or
columns if data is obtained from a database) must be recovered, and
keysValues specifies which set of records must be recovered.
This entity maps a table in the database, so all the hashtable keys must correspond to table columns, generally using column names as strings, but also other objects are processed.
This method ask for a connection and calls the following methods:
#processMultipleTableAttribute(Vector)TableEntity.processMultipleAttributeKey(Vector)TableEntity.query(Hashtable , Vector , int , Connection)
Then, if the result returned by query has no error, the
TableEntity.queryOtherEntities(Vector , EntityResult , int ) method is
called.
After that, this entity logs the operation if logQuery is
true.
If an SQLException is thrown, the TableEntity.getErrorMessage(SQLException)
method is called and the resulting messsage is set as the message in the
EntityResult returned by this entity.
The result returned by TableEntity.query(Hashtable , Vector , int , Connection)
method is returned by this method if no error ocurrs.
query in interface Entityquery in class TableEntitykeysValues - a Hashtable specifying conditions that must comply the set of
records returned. Cannot be null.attributes - a list of columns that must be recovered for each record
returned. Cannot be null. If empty, all attributes will be
returned.sessionId - a integer identifying the user or session that performs the
action.
java.lang.Exception - if any non handled exception occursTableEntity.query(Hashtable, Vector, int, Connection)
public EntityResult insert(java.util.Hashtable values,
int sessionId)
throws java.lang.Exception
TableEntityattributesValues parameter.This entity maps a table in the database, so all the hashtable keys must correspond to table columns, generally using column names as strings, but also other objects are processed.
This method ask for a connection, set autocommit to false, so operations are processed in a transaction, and calls the following methods:
After this, commit is executed and if no error is produced a DataChangeEvent.INSERT_EVENT is thrown.
If an SQLException is thrown, the TableEntity.getErrorMessage(SQLException)
method is called and the resulting message is set as the message in the
EntityResult returned by this entity.
The result returned by TableEntity.insert(Hashtable , int , Connection)
method is returned by this method if no error occurs.
If an autonumerical is defined for this entity and no error occurs, the value used in the insert operation is returned in the result as a pair or key-value where key is the column name, and value is the value used in the insert operation.
insert in interface Entityinsert in class TableEntityvalues - a Hashtable specifying pairs of key-value corresponding to the
attribute (or column of a table in a database) and the value
that must be stored.sessionId - a integer identifying the user or session that performs the
action.
java.lang.ExceptionTableEntity.insert(Hashtable , int , Connection)
public EntityResult update(java.util.Hashtable values,
java.util.Hashtable keys,
int sessionId)
throws java.lang.Exception
TableEntityattributesValues over the set of records defined by
keysValues. So, only the records that comply with the
conditions specified by keysValues will be updated to the new
values specified by attributesValues.
This entity maps a table in the database, so all the hashtable keys must correspond to table columns, generally using column names as strings, but also other objects are processed.
This method ask for a connection, set autocommit to false, so operations are processed in a transaction, and calls the following methods:
After this, commit is executed and if no error is produced a DataChangeEvent.UPDATE_EVENT is thrown.
If an SQLException is thrown, the TableEntity.getErrorMessage(SQLException)
method is called and the resulting message is set as the message in the
EntityResult returned by this entity.
update in interface Entityupdate in class TableEntityvalues - the data for updating the records to. The keys specify the
attributes (or columns) and the values, the values for these
columns.keys - the conditions that the records to be updated must fulfill. The
keys specify the attributes (or columns) and the values, the
values for these columns.sessionId - a integer identifying the user or session that performs the
action.
java.lang.Exception - if any exception occursTableEntity.update(Hashtable, Hashtable , int , Connection)
public EntityResult delete(java.util.Hashtable keys,
int sessionId)
throws java.lang.Exception
TableEntitykeysValues. So, only the records that
comply with the conditions specified by keysValues will be
deleted.
This entity maps a table in the database, so all the hashtable keys must correspond to table columns, generally using column names as strings, but also other objects are processed.
This method ask for a connection, set autocommit to false, so operations are processed in a transaction, and calls the following methods:
After this, commit is executed and if no error is produced a DataChangeEvent.DELETE_EVENT is thrown.
If an SQLException is thrown, the TableEntity.getErrorMessage(SQLException)
method is called and the resulting message is set as the message in the
EntityResult returned by this entity.
delete in interface Entitydelete in class TableEntitykeys - the conditions that the records to be deleted must fulfill. The
keys specify the attributes (or columns) and the values, the
values for these columns.sessionId - a integer identifying the user or session that performs the
action.
java.lang.Exception - if any exception occursTableEntity.delete(Hashtable, int , Connection)protected abstract void dataDeleted(java.util.Hashtable kv)
protected abstract void dataUpdated(java.util.Hashtable kv)
protected abstract void dataInserted(java.util.Hashtable av)
|
Ontimize | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||