|
Vordel SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vordel.es.impl.AbstractEntity com.vordel.es.Entity
public class Entity
The main component in the EntityStore. an Entity contains a
set of Fields which are accessible by name, as defined in the Entity's
relevant EntityType schema.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.vordel.common.Dictionary |
---|
com.vordel.common.Dictionary.MapAs |
Field Summary | |
---|---|
static java.lang.String |
ENV_EXPAND_INDICATOR
A field containing this substring will be expanded at runtime of the server |
protected EntityType |
type
The type of this Entity |
Fields inherited from class com.vordel.es.impl.AbstractEntity |
---|
parentPK, pk |
Constructor Summary | |
---|---|
Entity(EntityType type)
The constructor for all seasons |
Method Summary | |
---|---|
Entity |
cloneEntity()
Creates a deep copy of the entity, including keys. |
Entity |
cloneEntityFields()
Creates a deep copy of the entity, sans keys. |
boolean |
containsKey(java.lang.String fieldName)
Check to see if the field has been initialized for the Entity, and that it contains at least one non-null value. |
Entity |
createCopy()
Create a copy of this Entity, which will have no PKs set as it is a new 'virgin' Entity. |
java.lang.String |
describeReference(java.lang.String fieldName)
|
boolean |
equals(java.lang.Object obj)
Returns true if two Entity object are equal. |
boolean |
equalsContents(Entity other)
Returns true if the two Entities are of the same type and contain the same field values. |
boolean |
equalsKeys(Entity other)
|
java.lang.Object |
get(java.lang.String name)
'Dictionary' interface |
Field[] |
getAllFields()
|
byte[] |
getBinaryValue(java.lang.String fieldName)
|
byte[] |
getBinaryValue(java.lang.String fieldName,
int valueIndex)
|
boolean |
getBooleanValue(java.lang.String fieldName)
|
boolean |
getBooleanValue(java.lang.String fieldName,
int valueIndex)
|
byte[] |
getEncryptedValue(java.lang.String fieldName)
|
byte[] |
getEncryptedValue(java.lang.String fieldName,
int valueIndex)
|
Field |
getField(java.lang.String name)
Get a specific named field |
Field[] |
getInstanceFields()
Get all the fields defined in this Entity, excluding the constant field definitions, whose values can be obtained from the type def. |
int |
getIntegerValue(java.lang.String fieldName)
|
int |
getIntegerValue(java.lang.String fieldName,
int valueIndex)
|
java.lang.String |
getKeyDescription()
Convenience method to describe this entity in terms of its keys |
java.util.HashMap<java.lang.String,java.lang.Object> |
getKeyValues()
Returns the names and values of key fields of the entity |
long |
getLongValue(java.lang.String fieldName)
|
long |
getLongValue(java.lang.String fieldName,
int valueIndex)
|
ESPK |
getParentPK()
Get the unique identifier for this Entity's parent Entity |
ESPK |
getPK()
Get the unique identifier for this Entity |
java.util.List<Field> |
getReferenceFields()
|
java.util.Collection<ESPK> |
getReferences(java.lang.String fieldName)
Convenience method to get any references which the named field contains. |
ESPK |
getReferenceValue(java.lang.String fieldName)
Convienence method for getting the one single reference value of a reference field. |
java.util.Collection<Field> |
getReferringFields(ESPK refPK)
|
java.util.List<Field> |
getRefFields(boolean onlySoftRefs)
|
java.util.List<Field> |
getSoftReferenceFields()
|
java.lang.String |
getStringValue(java.lang.String fieldName)
|
java.lang.String |
getStringValue(java.lang.String fieldName,
int valueIndex)
|
java.util.Collection<java.lang.String> |
getStringValues(java.lang.String fieldName)
Get the string values for the specified field. |
EntityType |
getType()
Get the Type of this Entity |
int |
getValueCount(java.lang.String field)
|
boolean |
hasKey()
|
boolean |
isConstantField(java.lang.String fName)
|
boolean |
keyFieldsDiffer(Entity other)
|
void |
removeField(java.lang.String fName)
|
void |
setBinaryValue(java.lang.String fieldName,
byte[] binary)
Set the field to have a single value with the binary data supplied |
void |
setBooleanField(java.lang.String fieldName,
boolean val)
|
void |
setEncryptedValue(java.lang.String fieldName,
byte[] enc)
Convenience method for setting the encrypted bytes for a field |
void |
setField(Field f)
Set a Field for this Entity |
void |
setField(java.lang.String fName,
Value[] vals)
Convenience method to set the values for a field |
void |
setFields(java.lang.Object[][] fieldData)
Convenience method to set multiple single-valued field of various types |
void |
setIntegerField(java.lang.String fieldName,
int val)
|
void |
setLongField(java.lang.String fieldName,
long val)
|
Field |
setMVStringField(java.lang.String fieldName,
java.lang.String[] vals)
|
void |
setReferenceField(java.lang.String fieldName,
ESPK ref)
|
Field |
setStringField(java.lang.String fieldName,
java.lang.String val)
|
void |
setStringFields(java.lang.String[] fieldNames,
java.lang.String[] values)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected EntityType type
public static final java.lang.String ENV_EXPAND_INDICATOR
Constructor Detail |
---|
public Entity(EntityType type)
type
- The type of this EntityMethod Detail |
---|
public Entity cloneEntity()
public Entity cloneEntityFields()
public ESPK getPK()
getPK
in interface KeyHolder
public boolean hasKey()
public ESPK getParentPK()
public EntityType getType()
public Field getField(java.lang.String name)
name
- The name of the field to retrieve
public java.lang.Object get(java.lang.String name)
get
in interface com.vordel.common.Dictionary
public void setField(Field f) throws java.lang.IllegalArgumentException
f
-
java.lang.IllegalArgumentException
- if the field is a constant fieldpublic void setField(java.lang.String fName, Value[] vals) throws EntityStoreException
fName
- The name of the field to set the values forvals
- The values for the field
EntityStoreException
public void removeField(java.lang.String fName) throws EntityStoreException
EntityStoreException
public Field[] getAllFields()
public boolean isConstantField(java.lang.String fName)
public Field[] getInstanceFields()
public java.util.List<Field> getSoftReferenceFields()
public java.util.List<Field> getRefFields(boolean onlySoftRefs)
public java.util.List<Field> getReferenceFields()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getStringValue(java.lang.String fieldName, int valueIndex)
public java.lang.String getStringValue(java.lang.String fieldName)
public byte[] getBinaryValue(java.lang.String fieldName, int valueIndex) throws EntityStoreException
EntityStoreException
public byte[] getBinaryValue(java.lang.String fieldName) throws EntityStoreException
EntityStoreException
public byte[] getEncryptedValue(java.lang.String fieldName) throws EntityStoreException
EntityStoreException
public byte[] getEncryptedValue(java.lang.String fieldName, int valueIndex) throws EntityStoreException
EntityStoreException
public int getIntegerValue(java.lang.String fieldName, int valueIndex)
public int getIntegerValue(java.lang.String fieldName)
public long getLongValue(java.lang.String fieldName, int valueIndex)
public long getLongValue(java.lang.String fieldName)
public boolean getBooleanValue(java.lang.String fieldName, int valueIndex)
public boolean getBooleanValue(java.lang.String fieldName)
public ESPK getReferenceValue(java.lang.String fieldName)
fieldName
-
java.lang.IllegalArgumentException
- if the field is not of a reference typepublic java.util.Collection<ESPK> getReferences(java.lang.String fieldName)
fieldName
-
java.lang.IllegalArgumentException
- if the field specified is not part of
the type definition, or if the field is not of type 'reference'public int getValueCount(java.lang.String field)
public java.util.HashMap<java.lang.String,java.lang.Object> getKeyValues()
public Field setMVStringField(java.lang.String fieldName, java.lang.String[] vals) throws EntityStoreException
EntityStoreException
public void setLongField(java.lang.String fieldName, long val) throws EntityStoreException
EntityStoreException
public void setIntegerField(java.lang.String fieldName, int val) throws EntityStoreException
EntityStoreException
public void setBooleanField(java.lang.String fieldName, boolean val) throws EntityStoreException
EntityStoreException
public Field setStringField(java.lang.String fieldName, java.lang.String val) throws EntityStoreException
EntityStoreException
public void setStringFields(java.lang.String[] fieldNames, java.lang.String[] values) throws EntityStoreException
EntityStoreException
public void setBinaryValue(java.lang.String fieldName, byte[] binary) throws EntityStoreException
fieldName
- binary
-
EntityStoreException
public void setEncryptedValue(java.lang.String fieldName, byte[] enc) throws EntityStoreException
fieldName
- The name of the 'encrypted' type fieldenc
- The encrypted bytes
java.lang.IllegalArgumentException
- If the field doesn't exist, or isn't
of the type 'encrypted' or doesn't have the correct cardinality.
EntityStoreException
public void setReferenceField(java.lang.String fieldName, ESPK ref) throws EntityStoreException
EntityStoreException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean equalsContents(Entity other)
other
- The other Entity to compare to
public boolean equalsKeys(Entity other)
public Entity createCopy()
public boolean containsKey(java.lang.String fieldName)
containsKey
in interface com.vordel.common.Dictionary
public java.util.Collection<java.lang.String> getStringValues(java.lang.String fieldName)
fieldName
- The name of the Field as defined in the EntityType.
java.lang.IllegalArgumentException
- if the field does not exist, or if
it isn't of the string type.public void setFields(java.lang.Object[][] fieldData) throws EntityStoreException
fieldData
-
EntityStoreException
public java.util.Collection<Field> getReferringFields(ESPK refPK)
public java.lang.String describeReference(java.lang.String fieldName)
public java.lang.String getKeyDescription()
public boolean keyFieldsDiffer(Entity other)
|
Vordel SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |