public class LocalEntityInvocationHandler extends Object implements InvocationHandler, Entity, DynamicMemoryEntity
| Modifier and Type | Field and Description |
|---|---|
protected EntityResult |
cacheData |
protected Hashtable<String,Object> |
entityMetadata |
protected String |
entityName |
protected EntityReferenceLocator |
locator |
| Constructor and Description |
|---|
LocalEntityInvocationHandler(EntityReferenceLocator locator,
String entityName) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkInsertKeys(Hashtable attributesValues)
Checks if
attributesValues contains a value for all columns
defined in 'insert_keys' parameter. |
void |
clear() |
EntityResult |
delete(Hashtable keysValues,
int sessionId)
This method must implement a standard delete operation over the set of
records defined by
keysValues. |
protected String |
getAutonumerical() |
protected List<String> |
getGeneratedKeyList() |
EntityResult |
insert(Hashtable attributesValues,
int sessionId)
This method must implement a standard insert operation with the data
contained in
attributesValues parameter. |
Object |
invoke(Object proxy,
Method method,
Object[] args) |
EntityResult |
query(Hashtable keysValues,
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. |
void |
setValue(EntityResult data) |
EntityResult |
update(Hashtable attributesValues,
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. |
protected String entityName
protected EntityReferenceLocator locator
protected EntityResult cacheData
public LocalEntityInvocationHandler(EntityReferenceLocator locator, String entityName)
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke in interface InvocationHandlerThrowablepublic EntityResult insert(Hashtable attributesValues, int sessionId) throws Exception
EntityattributesValues parameter.insert in interface EntityattributesValues - 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.Exception - if any exception occurspublic EntityResult update(Hashtable attributesValues, Hashtable keysValues, int sessionId) throws Exception
EntityattributesValues 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.
update in interface EntityattributesValues - 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.Exception - if any exception occurspublic EntityResult query(Hashtable keysValues, Vector attributes, int sessionId) throws Exception
EntitykeysValues 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.
query in interface EntitykeysValues - 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.Exception - if any exception occurspublic void checkInsertKeys(Hashtable attributesValues) throws Exception
attributesValues contains a value for all columns
defined in 'insert_keys' parameter.
attributesValues - Exception - if any of the columns defined in 'insert_keys' is not found
as key in attributesValuesprotected String getAutonumerical()
public EntityResult delete(Hashtable keysValues, int sessionId) throws Exception
EntitykeysValues. So, only the records that
comply with the conditions specified by keysValues will be
deleted.
delete in interface EntitykeysValues - 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.Exception - if any exception occurspublic void setValue(EntityResult data)
setValue in interface DynamicMemoryEntitypublic void clear()
clear in interface DynamicMemoryEntityCopyright © 2016 Imatia Innovation S.L.. All rights reserved.