| Modifier and Type | Field and Description |
|---|---|
protected Properties |
alias |
protected String |
autonumericalColumn |
protected Vector |
columnNames |
protected EntityResult |
data |
protected Vector |
deleteKeys |
protected Vector |
descSortColumns |
protected String |
entityName |
protected Vector |
insertColumns |
protected Vector |
insertKeys |
protected Vector |
keys |
protected EntityReferenceLocator |
locator |
protected Vector |
otherEntities |
protected int |
privilegedId |
protected int |
queryOtherEntitiesLimit |
protected Hashtable |
reverseAlias |
protected Vector |
sortColumns |
protected Vector |
updateColumns |
protected Vector |
updateKeys |
protected Vector |
wildcardColumns |
| Constructor and Description |
|---|
MemoryEntity(EntityReferenceLocator referenceLocator) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkDeleteKeys(Hashtable filterKeys) |
void |
checkInsertKeys(Hashtable attributesValues) |
void |
checkUpdateKeys(Hashtable filterKeys) |
EntityResult |
delete(Hashtable keys,
int sessionId)
This method must implement a standard delete operation over the set of
records defined by
keysValues. |
String |
getAliasForColumn(String columnName) |
String |
getColumnForAlias(String alias) |
Vector |
getValidAttributes(Vector attributes) |
Hashtable |
getValidDeletingKeysValues(Hashtable filterKeys) |
Hashtable |
getValidInsertingAttributesValues(Hashtable attributesValues) |
Hashtable |
getValidQueryingKeysValues(Hashtable filterKeys) |
Hashtable |
getValidUpdatingAttributesValues(Hashtable attributesValues) |
Hashtable |
getValidUpdatingKeysValues(Hashtable filterKeys) |
EntityResult |
insert(Hashtable attributes,
int sessionId)
This method must implement a standard insert operation with the data
contained in
attributesValues parameter. |
protected void |
loadAliasFile()
Read the alias property file.
|
static Hashtable |
processReferenceDataFieldAttributes(Hashtable kv)
Process the reference data field attributes (
ReferenceFieldAttribute). |
static Vector |
processReferenceDataFieldAttributes(Vector referenceDataFieldAttributes)
Process the ReferenceFieldAttribute objects.
|
EntityResult |
query(Hashtable keys,
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. |
AdvancedEntityResult |
query(Hashtable keys,
Vector attributes,
int startIndex,
int number,
String orderBy,
int sessionId) |
void |
readProperties()
Reads the property file associated to the entity.
|
protected void |
readProperties(String path) |
EntityResult |
replaceAliasByColumn(EntityResult res)
This method replaces the name of the database columns with the
correspondant alias, so that the result has the same names to those
queried by the client.
|
Hashtable |
replaceAliasByColumn(Hashtable hash) |
Vector |
replaceAliasByColumn(Vector vect,
Vector changedColumns) |
EntityResult |
replaceColumnByAlias(EntityResult res,
Vector replacedColumnNames) |
Hashtable |
replaceColumnByAlias(Hashtable hash) |
Vector |
replaceColumnByAlias(Vector vect) |
EntityResult |
replaceColumnByAliasKeepColumns(EntityResult res) |
EntityResult |
update(Hashtable attributes,
Hashtable keys,
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 EntityResult data
protected Vector columnNames
protected Vector keys
protected Vector insertKeys
protected Vector deleteKeys
protected Vector updateKeys
protected Vector updateColumns
protected String autonumericalColumn
protected Vector insertColumns
protected Vector wildcardColumns
protected Vector sortColumns
protected Vector descSortColumns
protected Vector otherEntities
protected EntityReferenceLocator locator
protected int queryOtherEntitiesLimit
protected Properties alias
protected Hashtable reverseAlias
protected String entityName
protected int privilegedId
public MemoryEntity(EntityReferenceLocator referenceLocator) throws Exception
Exceptionprotected void loadAliasFile()
public void readProperties()
throws Exception
Exceptionpublic static Hashtable processReferenceDataFieldAttributes(Hashtable kv)
ReferenceFieldAttribute). kv - ReferenceFieldAttribute.getAttr()public void checkInsertKeys(Hashtable attributesValues) throws Exception
Exceptionpublic void checkUpdateKeys(Hashtable filterKeys) throws Exception
Exceptionpublic void checkDeleteKeys(Hashtable filterKeys) throws Exception
Exceptionpublic EntityResult replaceAliasByColumn(EntityResult res)
res - public EntityResult replaceColumnByAlias(EntityResult res, Vector replacedColumnNames)
public EntityResult replaceColumnByAliasKeepColumns(EntityResult res)
public Hashtable getValidInsertingAttributesValues(Hashtable attributesValues)
public Hashtable getValidUpdatingAttributesValues(Hashtable attributesValues)
public static Vector processReferenceDataFieldAttributes(Vector referenceDataFieldAttributes)
ReferenceFieldAttribute.getAttr() for all object of
ReferenceFieldAttribute type.referenceDataFieldAttributes - public AdvancedEntityResult query(Hashtable keys, Vector attributes, int startIndex, int number, String orderBy, int sessionId) throws Exception
Exceptionpublic EntityResult query(Hashtable keys, 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 Entitykeys - 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 EntityResult insert(Hashtable attributes, int sessionId) throws Exception
EntityattributesValues parameter.insert in interface Entityattributes - 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 attributes, Hashtable keys, 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 Entityattributes - 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.Exception - if any exception occurspublic EntityResult delete(Hashtable keys, int sessionId) throws Exception
EntitykeysValues. So, only the records that
comply with the conditions specified by keysValues will be
deleted.
delete in interface Entitykeys - 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 occursCopyright © 2016 Imatia Innovation S.L.. All rights reserved.