|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
org.ofbiz.entity.GenericEntity
org.ofbiz.entity.GenericValue
public class GenericValue
Generic Entity Value Object - Handles persistence for any defined entity.
Nested Class Summary | |
---|---|
protected static class |
GenericValue.NullGenericValue
|
Nested classes/interfaces inherited from class org.ofbiz.entity.GenericEntity |
---|
GenericEntity.NULL, GenericEntity.NullField, GenericEntity.NullGenericEntity |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary | |
---|---|
protected static |
genericValueFactory
|
static GenericValue |
NULL_VALUE
|
protected java.util.Map<java.lang.String,java.lang.Object> |
originalDbValues
This Map will contain the original field values from the database iff this GenericValue came from the database. |
java.util.Map<java.lang.String,java.util.List<GenericValue>> |
relatedCache
Map to cache various related entity collections |
java.util.Map<java.lang.String,GenericValue> |
relatedOneCache
Map to cache various related cardinality one entity collections |
Fields inherited from class org.ofbiz.entity.GenericEntity |
---|
cachedHashCode, delegatorName, entityName, fields, generateHashCode, internalDelegator, isFromEntitySync, modelEntity, modified, module, mutable, NULL_ENTITY, NULL_FIELD |
Constructor Summary | |
---|---|
protected |
GenericValue()
|
Method Summary | |
---|---|
boolean |
checkFks(boolean insertDummy)
Checks to see if all foreign key records exist in the database. |
void |
clearEmbeddedCache()
|
java.lang.Object |
clone()
Clones this GenericValue, this is a shallow clone & uses the default shallow HashMap clone |
void |
copyOriginalDbValues()
This should only be called by the Entity Engine once a GenericValue has been read from the database so that we have a copy of the original field values from the Db. |
GenericValue |
create()
|
static GenericValue |
create(GenericPK primaryKey)
Creates new GenericValue from existing GenericValue |
static GenericValue |
create(GenericValue value)
Creates new GenericValue from existing GenericValue |
static GenericValue |
create(ModelEntity modelEntity)
Creates new GenericValue |
static GenericValue |
create(ModelEntity modelEntity,
java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Creates new GenericValue from existing Map |
static GenericValue |
create(ModelEntity modelEntity,
java.lang.Object singlePkValue)
Creates new GenericValue from existing Map |
java.lang.Object |
getOriginalDbValue(java.lang.String name)
|
java.util.List<GenericValue> |
getRelated(java.lang.String relationName)
Get the named Related Entity for the GenericValue from the persistent store |
java.util.List<GenericValue> |
getRelated(java.lang.String relationName,
java.util.List<java.lang.String> orderBy)
Get the named Related Entity for the GenericValue from the persistent store |
java.util.List<GenericValue> |
getRelated(java.lang.String relationName,
java.util.Map<java.lang.String,? extends java.lang.Object> byAndFields,
java.util.List<java.lang.String> orderBy)
Get the named Related Entity for the GenericValue from the persistent store |
java.util.List<GenericValue> |
getRelatedByAnd(java.lang.String relationName,
java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Get the named Related Entity for the GenericValue from the persistent store and filter it |
java.util.List<GenericValue> |
getRelatedByAndCache(java.lang.String relationName,
java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Get the named Related Entity for the GenericValue from the persistent store and filter it, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant) |
java.util.List<GenericValue> |
getRelatedByAndEmbeddedCache(java.lang.String relationName,
java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Get the named Related Entity for the GenericValue from the persistent store and filter it, looking first in a cache associated with this entity which is destroyed with this ValueObject when no longer used. |
java.util.List<GenericValue> |
getRelatedCache(java.lang.String relationName)
Get the named Related Entity for the GenericValue from the persistent store, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant) |
java.util.List<GenericValue> |
getRelatedCache(java.lang.String relationName,
java.util.List<java.lang.String> orderBy)
Get the named Related Entity for the GenericValue from the persistent store, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant) |
java.util.List<GenericValue> |
getRelatedCache(java.lang.String relationName,
java.util.Map<java.lang.String,? extends java.lang.Object> byAndFields,
java.util.List<java.lang.String> orderBy)
Get the named Related Entity for the GenericValue from the persistent store, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant) |
GenericPK |
getRelatedDummyPK(java.lang.String relationName)
Get a dummy primary key for the named Related Entity for the GenericValue |
GenericPK |
getRelatedDummyPK(java.lang.String relationName,
java.util.Map<java.lang.String,? extends java.lang.Object> byAndFields)
Get a dummy primary key for the named Related Entity for the GenericValue |
java.util.List<GenericValue> |
getRelatedEmbeddedCache(java.lang.String relationName)
Get the named Related Entity for the GenericValue from the persistent store, looking first in a cache associated with this entity which is destroyed with this ValueObject when no longer used. |
java.util.List<GenericValue> |
getRelatedEmbeddedCache(java.lang.String relationName,
java.util.Map<java.lang.String,? extends java.lang.Object> byAndFields,
java.util.List<java.lang.String> orderBy)
Get the named Related Entity for the GenericValue from the persistent store, looking first in a cache associated with this entity which is destroyed with this ValueObject when no longer used. |
java.util.List<GenericValue> |
getRelatedMulti(java.lang.String relationNameOne,
java.lang.String relationNameTwo)
Get the named Related Entity for the GenericValue from the persistent store across another Relation. |
java.util.List<GenericValue> |
getRelatedMulti(java.lang.String relationNameOne,
java.lang.String relationNameTwo,
java.util.List<java.lang.String> orderBy)
Get the named Related Entity for the GenericValue from the persistent store across another Relation. |
GenericValue |
getRelatedOne(java.lang.String relationName)
Get the named Related Entity for the GenericValue from the persistent store |
GenericValue |
getRelatedOneCache(java.lang.String relationName)
Get the named Related Entity for the GenericValue from the persistent store, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant) |
GenericValue |
getRelatedOneEmbeddedCache(java.lang.String relationName)
Get the named Related Entity for the GenericValue from the persistent store, looking first in a cache associated with this entity which is destroyed with this ValueObject when no longer used. |
java.util.List<GenericValue> |
getRelatedOrderBy(java.lang.String relationName,
java.util.List<java.lang.String> orderBy)
Get the named Related Entity for the GenericValue from the persistent store and order it |
java.util.List<GenericValue> |
getRelatedOrderByCache(java.lang.String relationName,
java.util.List<java.lang.String> orderBy)
Get the named Related Entity for the GenericValue from the persistent store and order it, looking first in the global generic cache (for the moment this isn't true, is same as EmbeddedCache variant) |
java.util.List<GenericValue> |
getRelatedOrderByEmbeddedCache(java.lang.String relationName,
java.util.List<java.lang.String> orderBy)
Get the named Related Entity for the GenericValue from the persistent store and order it, looking first in a cache associated with this entity which is destroyed with this ValueObject when no longer used. |
boolean |
originalDbValuesAvailable()
|
void |
refresh()
|
void |
refreshFromCache()
|
void |
remove()
|
void |
removeRelated(java.lang.String relationName)
Remove the named Related Entity for the GenericValue from the persistent store |
void |
removeRelatedEmbeddedCache(java.lang.String relationName)
|
void |
reset()
|
void |
store()
|
void |
storeRelatedEmbeddedCache(java.lang.String relationName,
GenericValue value)
|
void |
storeRelatedEmbeddedCache(java.lang.String relationName,
java.util.List<GenericValue> col)
|
void |
synchronizedWithDatasource()
|
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final GenericValue NULL_VALUE
protected static finalgenericValueFactory
public transient java.util.Map<java.lang.String,java.util.List<GenericValue>> relatedCache
public transient java.util.Map<java.lang.String,GenericValue> relatedOneCache
protected java.util.Map<java.lang.String,java.lang.Object> originalDbValues
Constructor Detail |
---|
protected GenericValue()
Method Detail |
---|
public static GenericValue create(ModelEntity modelEntity)
public static GenericValue create(ModelEntity modelEntity, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
public static GenericValue create(ModelEntity modelEntity, java.lang.Object singlePkValue)
public static GenericValue create(GenericValue value)
public static GenericValue create(GenericPK primaryKey)
public void reset()
reset
in class GenericEntity
public void synchronizedWithDatasource()
synchronizedWithDatasource
in class GenericEntity
public GenericValue create() throws GenericEntityException
GenericEntityException
public void store() throws GenericEntityException
GenericEntityException
public void remove() throws GenericEntityException
GenericEntityException
public void refresh() throws GenericEntityException
GenericEntityException
public void refreshFromCache() throws GenericEntityException
GenericEntityException
public boolean originalDbValuesAvailable()
public java.lang.Object getOriginalDbValue(java.lang.String name)
public void copyOriginalDbValues()
public java.util.List<GenericValue> getRelated(java.lang.String relationName) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
GenericEntityException
public java.util.List<GenericValue> getRelated(java.lang.String relationName, java.util.List<java.lang.String> orderBy) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition fileorderBy
- The fields of the named entity to order the query by; may be null;
optionally add a " ASC" for ascending or " DESC" for descending
GenericEntityException
public java.util.List<GenericValue> getRelated(java.lang.String relationName, java.util.Map<java.lang.String,? extends java.lang.Object> byAndFields, java.util.List<java.lang.String> orderBy) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition filebyAndFields
- the fields that must equal in order to keep; may be nullorderBy
- The fields of the named entity to order the query by; may be null;
optionally add a " ASC" for ascending or " DESC" for descending
GenericEntityException
public java.util.List<GenericValue> getRelatedCache(java.lang.String relationName) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
GenericEntityException
public java.util.List<GenericValue> getRelatedMulti(java.lang.String relationNameOne, java.lang.String relationNameTwo, java.util.List<java.lang.String> orderBy) throws GenericEntityException
relationNameOne
- String containing the relation name which is the
combination of relation.title and relation.rel-entity-name as
specified in the entity XML definition file, for first relationrelationNameTwo
- String containing the relation name for second relationorderBy
- The fields of the named entity to order the query by; may be null;
optionally add a " ASC" for ascending or " DESC" for descending
GenericEntityException
public java.util.List<GenericValue> getRelatedMulti(java.lang.String relationNameOne, java.lang.String relationNameTwo) throws GenericEntityException
relationNameOne
- String containing the relation name which is the
combination of relation.title and relation.rel-entity-name as
specified in the entity XML definition file, for first relationrelationNameTwo
- String containing the relation name for second relation
GenericEntityException
public java.util.List<GenericValue> getRelatedCache(java.lang.String relationName, java.util.Map<java.lang.String,? extends java.lang.Object> byAndFields, java.util.List<java.lang.String> orderBy) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition filebyAndFields
- the fields that must equal in order to keep; may be nullorderBy
- The fields of the named entity to order the query by; may be null;
optionally add a " ASC" for ascending or " DESC" for descending
GenericEntityException
public java.util.List<GenericValue> getRelatedCache(java.lang.String relationName, java.util.List<java.lang.String> orderBy) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition fileorderBy
- The fields of the named entity to order the query by; may be null;
optionally add a " ASC" for ascending or " DESC" for descending
GenericEntityException
public java.util.List<GenericValue> getRelatedEmbeddedCache(java.lang.String relationName) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
GenericEntityException
public java.util.List<GenericValue> getRelatedEmbeddedCache(java.lang.String relationName, java.util.Map<java.lang.String,? extends java.lang.Object> byAndFields, java.util.List<java.lang.String> orderBy) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition filebyAndFields
- the fields that must equal in order to keep; may be nullorderBy
- The fields of the named entity to order the query by; may be null;
optionally add a " ASC" for ascending or " DESC" for descending
GenericEntityException
public void removeRelatedEmbeddedCache(java.lang.String relationName)
public void storeRelatedEmbeddedCache(java.lang.String relationName, java.util.List<GenericValue> col)
public void storeRelatedEmbeddedCache(java.lang.String relationName, GenericValue value)
public void clearEmbeddedCache()
public GenericValue getRelatedOne(java.lang.String relationName) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
GenericEntityException
public GenericValue getRelatedOneCache(java.lang.String relationName) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
GenericEntityException
public GenericValue getRelatedOneEmbeddedCache(java.lang.String relationName) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
GenericEntityException
public java.util.List<GenericValue> getRelatedByAnd(java.lang.String relationName, java.util.Map<java.lang.String,? extends java.lang.Object> fields) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition filefields
- the fields that must equal in order to keep
GenericEntityException
public java.util.List<GenericValue> getRelatedByAndCache(java.lang.String relationName, java.util.Map<java.lang.String,? extends java.lang.Object> fields) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition filefields
- the fields that must equal in order to keep
GenericEntityException
public java.util.List<GenericValue> getRelatedByAndEmbeddedCache(java.lang.String relationName, java.util.Map<java.lang.String,? extends java.lang.Object> fields) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition filefields
- the fields that must equal in order to keep
GenericEntityException
public java.util.List<GenericValue> getRelatedOrderBy(java.lang.String relationName, java.util.List<java.lang.String> orderBy) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition fileorderBy
- the order that they should be returned
GenericEntityException
public java.util.List<GenericValue> getRelatedOrderByCache(java.lang.String relationName, java.util.List<java.lang.String> orderBy) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition fileorderBy
- the order that they should be returned
GenericEntityException
public java.util.List<GenericValue> getRelatedOrderByEmbeddedCache(java.lang.String relationName, java.util.List<java.lang.String> orderBy) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition fileorderBy
- the order that they should be returned
GenericEntityException
public void removeRelated(java.lang.String relationName) throws GenericEntityException
relationName
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
GenericEntityException
public GenericPK getRelatedDummyPK(java.lang.String relationName) throws GenericEntityException
relationName
- String containing the relation name which is the
combination of relation.title and relation.rel-entity-name as
specified in the entity XML definition file
GenericEntityException
public GenericPK getRelatedDummyPK(java.lang.String relationName, java.util.Map<java.lang.String,? extends java.lang.Object> byAndFields) throws GenericEntityException
relationName
- String containing the relation name which is the
combination of relation.title and relation.rel-entity-name as
specified in the entity XML definition filebyAndFields
- the fields that must equal in order to keep; may be null
GenericEntityException
public boolean checkFks(boolean insertDummy) throws GenericEntityException
insertDummy
- Create a dummy record using the provided fields
GenericEntityException
public java.lang.Object clone()
clone
in class GenericEntity
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |