Ontimize 5.2072EN

com.ontimize.db
Interface Entity

All Superinterfaces:
java.rmi.Remote
All Known Subinterfaces:
AdvancedEntity, AdvancedQueryEntity, DelegationEntity, DirectSQLQueryEntity
All Known Implementing Classes:
MemoryEntity, SQLEntity, TableEntity

public interface Entity
extends java.rmi.Remote

This interface defines the basic methods that must be implemented by any class (entity) that provides and receives data from the Ontimize client classes (for example, forms and trees).

Defines four methods corresponding to the basic operations that generally can be done when managing data:

Classes that implement these methods must ensure that the argument objects passed to the methods are not modified. This interface extends java.rmi.Remote so that methods of this interface can be called using RMI, but this is not required, and instances of objects can be used locally.

Author:
Imatia Innovation S.L.

Method Summary
 EntityResult delete(java.util.Hashtable keysValues, int sessionId)
          This method must implement a standard delete operation over the set of records defined by keysValues.
 EntityResult insert(java.util.Hashtable attributesValues, int sessionId)
          This method must implement a standard insert operation with the data contained in attributesValues parameter.
 EntityResult query(java.util.Hashtable keysValues, java.util.Vector attributes, int sessionId)
          This method must implement a standard query operation returning the set of data that matches the conditions specified by the keysValues parameter.
 EntityResult update(java.util.Hashtable attributesValues, java.util.Hashtable keysValues, int sessionId)
          This method must implement a standard update operation with the data specified in attributesValues over the set of records defined by keysValues.
 

Method Detail

query

public EntityResult query(java.util.Hashtable keysValues,
                          java.util.Vector attributes,
                          int sessionId)
                   throws java.lang.Exception
This method must implement a standard query operation returning the set of data that matches the conditions specified by the keysValues 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.

Parameters:
keysValues - a Hashtable specifying conditions that must comply the set of records returned. Cannot be null.
attributes - a list of columns or attributes that must be recovered for each record returned. Cannot be null. If empty, all attributes should be returned.
sessionId - a integer identifying the user or session that performs the action.
Returns:
a EntityResult with the resulting set of data. This result can be empty if no results exist, and if an error has ocurred this will be indicated in the result.
Throws:
java.lang.Exception - if any exception occurs

insert

public EntityResult insert(java.util.Hashtable attributesValues,
                           int sessionId)
                    throws java.lang.Exception
This method must implement a standard insert operation with the data contained in attributesValues parameter.

Parameters:
attributesValues - 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.
Returns:
a EntityResult. This result will have an error code if error has ocurred.
Throws:
java.lang.Exception - if any exception occurs

update

public EntityResult update(java.util.Hashtable attributesValues,
                           java.util.Hashtable keysValues,
                           int sessionId)
                    throws java.lang.Exception
This method must implement a standard update operation with the data specified in attributesValues 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.

Parameters:
attributesValues - the data for updating the records to. The keys specify the attributes (or columns) and the values, the values for these columns.
keysValues - 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.
Returns:
a EntityResult. This result will have an error code if error has occurred.
Throws:
java.lang.Exception - if any exception occurs

delete

public EntityResult delete(java.util.Hashtable keysValues,
                           int sessionId)
                    throws java.lang.Exception
This method must implement a standard delete operation over the set of records defined by keysValues. So, only the records that comply with the conditions specified by keysValues will be deleted.

Parameters:
keysValues - 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.
Returns:
a EntityResult. This result will have an error code if error has occurred.
Throws:
java.lang.Exception - if any exception occurs

Ontimize