org.ofbiz.entity
Class GenericDelegator

java.lang.Object
  extended by org.ofbiz.entity.GenericDelegator
All Implemented Interfaces:
DelegatorInterface

public class GenericDelegator
extends java.lang.Object
implements DelegatorInterface

Generic Data Source Delegator Class


Nested Class Summary
protected static class GenericDelegator.EntityEcaRuleRunner<T>
           
 class GenericDelegator.TestOperation
           
 
Field Summary
static boolean alwaysUseTransaction
          This flag is only here for lower level technical testing, it shouldn't be user configurable (or at least I don't think so yet); when true all operations without a transaction will be wrapped in one; seems to be necessary for some (all?) XA aware connection pools, and should improve overall stability and consistency
protected  java.util.Map andCacheFieldSets
          keeps a list of field key sets used in the by and cache, a Set (of Sets of fieldNames) for each entityName
protected  Cache cache
           
protected  EntityCrypto crypto
           
protected static java.util.Map<java.lang.String,GenericDelegator> delegatorCache
          the delegatorCache will now be a HashMap, allowing reload of definitions, but the delegator will always be the same object for the given name
protected  DelegatorInfo delegatorInfo
           
protected  java.lang.String delegatorName
           
protected  DistributedCacheClear distributedCacheClear
           
protected  EntityEcaHandler<?> entityEcaHandler
           
protected  ModelGroupReader modelGroupReader
           
protected  ModelReader modelReader
           
static java.lang.String module
           
protected  SequenceUtil sequencer
           
protected static java.lang.ThreadLocal<java.util.List<java.lang.Object>> sessionIdentifierStack
          A ThreadLocal variable to allow other methods to specify a session identifier (usually the visitId, though technically the Entity Engine doesn't know anything about the Visit entity)
protected static java.lang.ThreadLocal<java.util.List<java.lang.Object>> userIdentifierStack
          A ThreadLocal variable to allow other methods to specify a user identifier (usually the userLoginId, though technically the Entity Engine doesn't know anything about the UserLogin entity)
 
Constructor Summary
protected GenericDelegator()
          Only allow creation through the factory method
protected GenericDelegator(java.lang.String delegatorName)
          Only allow creation through the factory method
 
Method Summary
protected  void absorbList(java.util.List<GenericValue> lst)
           
 void clearAllCacheLinesByDummyPK(java.util.Collection<GenericPK> dummyPKs)
           
 void clearAllCacheLinesByValue(java.util.Collection<GenericValue> values)
           
 void clearAllCaches()
          This method is a shortcut to completely clear all entity engine caches.
 void clearAllCaches(boolean distribute)
           
 void clearCacheLine(GenericPK primaryKey)
          Remove a CACHED Generic Entity from the cache by its primary key, does NOT check to see if the passed GenericPK is a complete primary key.
 void clearCacheLine(GenericPK primaryKey, boolean distribute)
           
 void clearCacheLine(GenericValue value)
          Remove a CACHED GenericValue from as many caches as it can.
 void clearCacheLine(GenericValue value, boolean distribute)
           
 void clearCacheLine(java.lang.String entityName)
          Remove all CACHED Generic Entity (List) from the cache
 void clearCacheLine(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          Remove a CACHED Generic Entity (List) from the cache, either a PK, ByAnd, or All
 void clearCacheLine(java.lang.String entityName, java.lang.Object... fields)
          Remove a CACHED Generic Entity (List) from the cache, either a PK, ByAnd, or All
 void clearCacheLineByCondition(java.lang.String entityName, EntityCondition condition)
           
 void clearCacheLineByCondition(java.lang.String entityName, EntityCondition condition, boolean distribute)
           
 void clearCacheLineFlexible(GenericEntity dummyPK)
          Remove a CACHED Generic Entity from the cache by its primary key.
 void clearCacheLineFlexible(GenericEntity dummyPK, boolean distribute)
           
protected  void clearCacheValues(UtilCache cache, java.lang.String entityName, EntityCondition condition)
           
static void clearSessionIdentifierStack()
           
static void clearUserIdentifierStack()
           
 GenericDelegator cloneDelegator()
           
 GenericDelegator cloneDelegator(java.lang.String delegatorName)
           
 GenericValue create(GenericPK primaryKey)
          Creates a Entity in the form of a GenericValue and write it to the datasource
 GenericValue create(GenericPK primaryKey, boolean doCacheClear)
          Creates a Entity in the form of a GenericValue and write it to the datasource
 GenericValue create(GenericValue value)
          Creates a Entity in the form of a GenericValue and write it to the datasource
 GenericValue create(GenericValue value, boolean doCacheClear)
          Creates a Entity in the form of a GenericValue and write it to the datasource
 GenericValue create(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          Creates a Entity in the form of a GenericValue and write it to the database
 GenericValue create(java.lang.String entityName, java.lang.Object... fields)
          Creates a Entity in the form of a GenericValue and write it to the database
protected  void createEntityAuditLogAll(GenericValue value, boolean isUpdate, boolean isRemove)
           
protected  void createEntityAuditLogSingle(GenericValue value, ModelField mf, boolean isUpdate, boolean isRemove)
           
protected static
<T> GenericDelegator.EntityEcaRuleRunner<T>
createEntityEcaRuleRunner(EntityEcaHandler<T> entityEcaHandler, java.lang.String entityName)
           
 GenericValue createOrStore(GenericValue value)
          Creates or stores an Entity
 GenericValue createOrStore(GenericValue value, boolean doCacheClear)
          Creates or stores an Entity
 GenericValue createSetNextSeqId(GenericValue value)
          Sets the sequenced ID (for entity with one primary key field ONLY), and then does a create in the database as normal.
 GenericValue createSingle(java.lang.String entityName, java.lang.Object singlePkValue)
          Creates a Entity in the form of a GenericValue and write it to the database
 void decryptFields(GenericEntity entity)
           
 void decryptFields(java.util.List<? extends GenericEntity> entities)
           
 void encryptFields(GenericEntity entity)
           
 void encryptFields(java.util.List<? extends GenericEntity> entities)
           
 java.lang.Object encryptFieldValue(java.lang.String entityName, java.lang.Object fieldValue)
           
 EntityListIterator find(java.lang.String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, java.util.Set<java.lang.String> fieldsToSelect, java.util.List<java.lang.String> orderBy, EntityFindOptions findOptions)
          Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
 java.util.List<GenericValue> findAll(java.lang.String entityName)
          Finds all Generic entities NOTE 20080502: 14 references; all changed to findList
 java.util.List<GenericValue> findAll(java.lang.String entityName, java.util.List<java.lang.String> orderBy)
          Finds all Generic entities NOTE 20080502: 10 references; all changed to findList
 java.util.List<GenericValue> findAll(java.lang.String entityName, java.lang.String... orderBy)
          Finds all Generic entities NOTE 20080502: 0 references
 java.util.List<GenericValue> findAllByPrimaryKeys(java.util.Collection<GenericPK> primaryKeys)
          Find a number of Generic Value objects by their Primary Keys, all at once NOTE 20080502: 0 references
 java.util.List<GenericValue> findAllByPrimaryKeysCache(java.util.Collection<GenericPK> primaryKeys)
          Find a number of Generic Value objects by their Primary Keys, all at once; this first looks in the local cache for each PK and if there then it puts it in the return list rather than putting it in the batch to send to a given helper.
 java.util.List<GenericValue> findAllCache(java.lang.String entityName)
          Finds all Generic entities, looking first in the cache NOTE 20080502: 4 references; all changed to findList
 java.util.List<GenericValue> findAllCache(java.lang.String entityName, java.util.List<java.lang.String> orderBy)
          Finds all Generic entities, looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields NOTE 20080502: 2 references; all changed to findList
 java.util.List<GenericValue> findAllCache(java.lang.String entityName, java.lang.String... orderBy)
          Finds all Generic entities, looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields NOTE 20080502: 0 references
<T extends EntityCondition>
java.util.List<GenericValue>
findByAnd(java.lang.String entityName, java.util.List<T> expressions)
          Finds Generic Entity records by all of the specified expressions (ie: combined using AND) NOTE 20080502: 11 references; all changed to findList
<T extends EntityCondition>
java.util.List<GenericValue>
findByAnd(java.lang.String entityName, java.util.List<T> expressions, java.util.List<java.lang.String> orderBy)
          Finds Generic Entity records by all of the specified expressions (ie: combined using AND) NOTE 20080502: 24 references; all changed to findList
 java.util.List<GenericValue> findByAnd(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          Finds Generic Entity records by all of the specified fields (ie: combined using AND) NOTE 20080502: 264 references
 java.util.List<GenericValue> findByAnd(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields, java.util.List<java.lang.String> orderBy)
          Finds Generic Entity records by all of the specified fields (ie: combined using AND) NOTE 20080502: 72 references
 java.util.List<GenericValue> findByAnd(java.lang.String entityName, java.lang.Object... fields)
          Deprecated.  
<T extends EntityCondition>
java.util.List<GenericValue>
findByAnd(java.lang.String entityName, T... expressions)
          Finds Generic Entity records by all of the specified expressions (ie: combined using AND) NOTE 20080502: 0 references
 java.util.List<GenericValue> findByAndCache(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          Finds Generic Entity records by all of the specified fields (ie: combined using AND), looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields NOTE 20080502: 91 references
 java.util.List<GenericValue> findByAndCache(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields, java.util.List<java.lang.String> orderBy)
          Finds Generic Entity records by all of the specified fields (ie: combined using AND), looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields NOTE 20080502: 56 references
 java.util.List<GenericValue> findByAndCache(java.lang.String entityName, java.lang.Object... fields)
          Finds Generic Entity records by all of the specified fields (ie: combined using AND), looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields NOTE 20080502: 0 references
 java.util.List<GenericValue> findByCondition(java.lang.String entityName, EntityCondition entityCondition, java.util.Collection<java.lang.String> fieldsToSelect, java.util.List<java.lang.String> orderBy)
          Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
 java.util.List<GenericValue> findByCondition(java.lang.String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, java.util.Collection<java.lang.String> fieldsToSelect, java.util.List<java.lang.String> orderBy, EntityFindOptions findOptions)
          Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
 java.util.List<GenericValue> findByConditionCache(java.lang.String entityName, EntityCondition entityCondition, java.util.Collection<java.lang.String> fieldsToSelect, java.util.List<java.lang.String> orderBy)
          Finds GenericValues by the conditions specified in the EntityCondition object, looking first in the cache, see the EntityCondition javadoc for more details.
 java.util.List<GenericValue> findByLike(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          NOTE 20080502: 1 references; all changed to findList
 java.util.List<GenericValue> findByLike(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields, java.util.List<java.lang.String> orderBy)
          NOTE 20080502: 1 references; all changed to findList
 java.util.List<GenericValue> findByLike(java.lang.String entityName, java.lang.Object... fields)
          NOTE 20080502: 0 references
<T extends EntityCondition>
java.util.List<GenericValue>
findByOr(java.lang.String entityName, java.util.List<T> expressions)
          Finds Generic Entity records by all of the specified expressions (ie: combined using OR) NOTE 20080502: 2 references; all changed to findList
<T extends EntityCondition>
java.util.List<GenericValue>
findByOr(java.lang.String entityName, java.util.List<T> expressions, java.util.List<java.lang.String> orderBy)
          Finds Generic Entity records by all of the specified expressions (ie: combined using OR) NOTE 20080502: 0 references
 java.util.List<GenericValue> findByOr(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          Finds Generic Entity records by all of the specified fields (ie: combined using OR) NOTE 20080502: 1 references; all changed to findList
 java.util.List<GenericValue> findByOr(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields, java.util.List<java.lang.String> orderBy)
          Finds Generic Entity records by all of the specified fields (ie: combined using OR) NOTE 20080502: 1 references; all changed to findList
 java.util.List<GenericValue> findByOr(java.lang.String entityName, java.lang.Object... fields)
          Deprecated.  
<T extends EntityCondition>
java.util.List<GenericValue>
findByOr(java.lang.String entityName, T... expressions)
          Finds Generic Entity records by all of the specified expressions (ie: combined using OR) NOTE 20080502: 0 references
 GenericValue findByPrimaryKey(GenericPK primaryKey)
          Find a Generic Entity by its Primary Key NOTE 20080502: 15 references; all changed to findOne
 GenericValue findByPrimaryKey(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          Find a Generic Entity by its Primary Key NOTE 20080502: 550 references (20080503 521 left); needs to be deprecated, should use findOne instead, but lots of stuff to replace!
 GenericValue findByPrimaryKey(java.lang.String entityName, java.lang.Object... fields)
          Find a Generic Entity by its Primary Key NOTE 20080502: 21 references; all changed to findOne
 GenericValue findByPrimaryKeyCache(GenericPK primaryKey)
          Find a CACHED Generic Entity by its Primary Key NOTE 20080502: 2 references; all changed to findOne
 GenericValue findByPrimaryKeyCache(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          Find a CACHED Generic Entity by its Primary Key NOTE 20080502: 218 references
 GenericValue findByPrimaryKeyCache(java.lang.String entityName, java.lang.Object... fields)
          Find a CACHED Generic Entity by its Primary Key NOTE 20080502: 2 references
 GenericValue findByPrimaryKeyCacheSingle(java.lang.String entityName, java.lang.Object singlePkValue)
          Find a CACHED Generic Entity by its Primary Key NOTE 20080502: 0 references
 GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, java.util.Set<java.lang.String> keys)
          Find a Generic Entity by its Primary Key and only returns the values requested by the passed keys (names) NOTE 20080502: 3 references
 GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, java.lang.String... keys)
          Find a Generic Entity by its Primary Key and only returns the values requested by the passed keys (names) NOTE 20080502: 0 references
 GenericValue findByPrimaryKeySingle(java.lang.String entityName, java.lang.Object singlePkValue)
          Find a Generic Entity by its Primary Key NOTE 20080502: 0 references
 long findCountByAnd(java.lang.String entityName)
          NOTE 20080502: 3 references; all changed to findCoundByCondition
 long findCountByAnd(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          NOTE 20080502: 8 references; all changed to use findCountByCondition
 long findCountByAnd(java.lang.String entityName, java.lang.Object... fields)
          NOTE 20080502: 1 references; all changed to use findCountByCondition
 long findCountByCondition(java.lang.String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition)
          NOTE 20080502: 17 references; all changed to use remaining findCountByCondition
 long findCountByCondition(java.lang.String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, EntityFindOptions findOptions)
          NOTE 20080502: 2 references
 java.util.List<GenericValue> findList(java.lang.String entityName, EntityCondition entityCondition, java.util.Set<java.lang.String> fieldsToSelect, java.util.List<java.lang.String> orderBy, EntityFindOptions findOptions, boolean useCache)
          Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
 EntityListIterator findListIteratorByCondition(DynamicViewEntity dynamicViewEntity, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, java.util.Collection<java.lang.String> fieldsToSelect, java.util.List<java.lang.String> orderBy, EntityFindOptions findOptions)
          Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
 EntityListIterator findListIteratorByCondition(java.lang.String entityName, EntityCondition entityCondition, java.util.Collection<java.lang.String> fieldsToSelect, java.util.List<java.lang.String> orderBy)
          Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
 EntityListIterator findListIteratorByCondition(java.lang.String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, java.util.Collection<java.lang.String> fieldsToSelect, java.util.List<java.lang.String> orderBy, EntityFindOptions findOptions)
          Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
 GenericValue findOne(java.lang.String entityName, boolean useCache, java.lang.Object... fields)
          Find a Generic Entity by its Primary Key NOTE 20080502: 6 references
 GenericValue findOne(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields, boolean useCache)
          Find a Generic Entity by its Primary Key NOTE 20080502: 6 references
 Cache getCache()
           
static java.lang.String getCurrentSessionIdentifier()
           
static java.lang.String getCurrentUserIdentifier()
           
protected  DelegatorInfo getDelegatorInfo()
           
 java.lang.String getDelegatorName()
           
protected  GenericDelegator.EntityEcaRuleRunner<?> getEcaRuleRunner(java.lang.String entityName)
           
 EntityEcaHandler getEntityEcaHandler()
           
 ModelFieldType getEntityFieldType(ModelEntity entity, java.lang.String type)
          Gets a field type instance by name from the helper that corresponds to the specified entity
 java.util.Collection<java.lang.String> getEntityFieldTypeNames(ModelEntity entity)
          Gets field type names from the helper that corresponds to the specified entity
 java.lang.String getEntityGroupName(java.lang.String entityName)
          Gets the helper name that corresponds to this delegator and the specified entityName
 GenericHelper getEntityHelper(ModelEntity entity)
          Gets the an instance of helper that corresponds to this delegator and the specified entity
 GenericHelper getEntityHelper(java.lang.String entityName)
          Gets the an instance of helper that corresponds to this delegator and the specified entityName
 java.lang.String getEntityHelperName(ModelEntity entity)
          Gets the helper name that corresponds to this delegator and the specified entity
 java.lang.String getEntityHelperName(java.lang.String entityName)
          Gets the helper name that corresponds to this delegator and the specified entityName
 GenericValue getFromPrimaryKeyCache(GenericPK primaryKey)
           
static GenericDelegator getGenericDelegator(java.lang.String delegatorName)
           
 java.lang.String getGroupHelperName(java.lang.String groupName)
          Gets the helper name that corresponds to this delegator and the specified entityName
 ModelEntity getModelEntity(java.lang.String entityName)
          Gets the instance of ModelEntity that corresponds to this delegator and the specified entityName
 java.util.Map<java.lang.String,ModelEntity> getModelEntityMapByGroup(java.lang.String groupName)
          Gets a Map of entity name & entity model pairs that are in the named group
 ModelGroupReader getModelGroupReader()
          Gets the instance of ModelGroupReader that corresponds to this delegator
 ModelReader getModelReader()
          Gets the instance of ModelReader that corresponds to this delegator
 java.util.List<GenericValue> getMultiRelation(GenericValue value, 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> getMultiRelation(GenericValue value, 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.
 java.lang.String getNextSeqId(java.lang.String seqName)
          Get the next guaranteed unique seq id from the sequence with the given sequence name; if the named sequence doesn't exist, it will be created
 java.lang.String getNextSeqId(java.lang.String seqName, long staggerMax)
          Get the next guaranteed unique seq id from the sequence with the given sequence name; if the named sequence doesn't exist, it will be created
 java.lang.Long getNextSeqIdLong(java.lang.String seqName)
          Get the next guaranteed unique seq id from the sequence with the given sequence name; if the named sequence doesn't exist, it will be created
 java.lang.Long getNextSeqIdLong(java.lang.String seqName, long staggerMax)
          Get the next guaranteed unique seq id from the sequence with the given sequence name; if the named sequence doesn't exist, it will be created
 java.lang.String getOriginalDelegatorName()
          Gets the name of the server configuration that corresponds to this delegator
 java.util.List<GenericValue> getRelated(java.lang.String relationName, GenericValue value)
          Get the named Related Entity for the GenericValue from the persistent store NOTE 20080502: 1 references; all changed to use remaining getRelated
 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, GenericValue value)
          Get the named Related Entity for the GenericValue from the persistent store NOTE 20080502: 5 references
 java.util.List<GenericValue> getRelatedByAnd(java.lang.String relationName, java.util.Map<java.lang.String,? extends java.lang.Object> byAndFields, GenericValue value)
          Get the named Related Entity for the GenericValue from the persistent store NOTE 20080502: 1 references; all changed to use getRelated
 java.util.List<GenericValue> getRelatedCache(java.lang.String relationName, GenericValue value)
          Get the named Related Entity for the GenericValue from the persistent store, checking first in the cache to see if the desired value is there NOTE 20080502: 4 references
 GenericPK getRelatedDummyPK(java.lang.String relationName, java.util.Map<java.lang.String,? extends java.lang.Object> byAndFields, GenericValue value)
          Get a dummy primary key for the named Related Entity for the GenericValue NOTE 20080502: 2 references
 GenericValue getRelatedOne(java.lang.String relationName, GenericValue value)
          Get related entity where relation is of type one, uses findByPrimaryKey NOTE 20080502: 7 references
 GenericValue getRelatedOneCache(java.lang.String relationName, GenericValue value)
          Get related entity where relation is of type one, uses findByPrimaryKey, checking first in the cache to see if the desired value is there NOTE 20080502: 1 references
 java.util.List<GenericValue> getRelatedOrderBy(java.lang.String relationName, java.util.List<java.lang.String> orderBy, GenericValue value)
          Get the named Related Entity for the GenericValue from the persistent store NOTE 20080502: 1 references; all changed to use getRelated
protected static java.util.List<java.lang.Object> getSessionIdentifierStack()
           
protected static java.util.List<java.lang.Object> getUserIdentifierStack()
           
 void initEntityEcaHandler()
           
 GenericPK makePK(org.w3c.dom.Element element)
           
 GenericPK makePK(java.lang.String entityName)
          Creates a Primary Key in the form of a GenericPK without persisting it
 GenericPK makePK(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          Creates a Primary Key in the form of a GenericPK without persisting it
 GenericPK makePK(java.lang.String entityName, java.lang.Object... fields)
          Creates a Primary Key in the form of a GenericPK without persisting it
 GenericPK makePKSingle(java.lang.String entityName, java.lang.Object singlePkValue)
          Creates a Primary Key in the form of a GenericPK without persisting it
 GenericDelegator makeTestDelegator(java.lang.String delegatorName)
           
 GenericValue makeValidValue(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          Creates a Entity in the form of a GenericValue without persisting it; only valid fields will be pulled from the fields Map
 GenericValue makeValidValue(java.lang.String entityName, java.lang.Object... fields)
          Creates a Entity in the form of a GenericValue without persisting it; only valid fields will be pulled from the fields Map
 GenericValue makeValue(org.w3c.dom.Element element)
           
 GenericValue makeValue(java.lang.String entityName)
          Creates a Entity in the form of a GenericValue without persisting it
 GenericValue makeValue(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          Creates a Entity in the form of a GenericValue without persisting it
 GenericValue makeValue(java.lang.String entityName, java.lang.Object... fields)
          Creates a Entity in the form of a GenericValue without persisting it
 java.util.List<GenericValue> makeValues(org.w3c.dom.Document document)
           
 GenericValue makeValueSingle(java.lang.String entityName, java.lang.Object singlePkValue)
          Creates a Entity in the form of a GenericValue without persisting it
static java.lang.String popSessionIdentifier()
           
static java.lang.String popUserIdentifier()
           
static void pushSessionIdentifier(java.lang.String sessionIdentifier)
           
static void pushUserIdentifier(java.lang.String userIdentifier)
           
 void putAllInPrimaryKeyCache(java.util.List<GenericValue> values)
           
 void putInPrimaryKeyCache(GenericPK primaryKey, GenericValue value)
           
 java.util.List<GenericValue> readXmlDocument(java.net.URL url)
           
 void refresh(GenericValue value)
          Refresh the Entity for the GenericValue from the persistent store
 void refresh(GenericValue value, boolean doCacheClear)
          Refresh the Entity for the GenericValue from the persistent store
 void refreshFromCache(GenericValue value)
          Refresh the Entity for the GenericValue from the cache
 void refreshSequencer()
          Refreshes the ID sequencer clearing all cached bank values.
 int removeAll(java.util.List<? extends GenericEntity> dummyPKs)
          Remove the Entities from the List from the persistent store.
 int removeAll(java.util.List<? extends GenericEntity> dummyPKs, boolean doCacheClear)
          Remove the Entities from the List from the persistent store.
 int removeAll(java.lang.String entityName)
           
 int removeByAnd(java.lang.String entityName, boolean doCacheClear, java.lang.Object... fields)
          Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND)
 int removeByAnd(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
          Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND)
 int removeByAnd(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields, boolean doCacheClear)
          Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND)
 int removeByAnd(java.lang.String entityName, java.lang.Object... fields)
          Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND)
 int removeByCondition(java.lang.String entityName, EntityCondition condition)
          Removes/deletes Generic Entity records found by the condition
 int removeByCondition(java.lang.String entityName, EntityCondition condition, boolean doCacheClear)
          Removes/deletes Generic Entity records found by the condition
 int removeByPrimaryKey(GenericPK primaryKey)
          Remove a Generic Entity corresponding to the primaryKey
 int removeByPrimaryKey(GenericPK primaryKey, boolean doCacheClear)
          Remove a Generic Entity corresponding to the primaryKey
 int removeRelated(java.lang.String relationName, GenericValue value)
          Remove the named Related Entity for the GenericValue from the persistent store
 int removeRelated(java.lang.String relationName, GenericValue value, boolean doCacheClear)
          Remove the named Related Entity for the GenericValue from the persistent store
 int removeValue(GenericValue value)
          Remove a Generic Value from the database
 int removeValue(GenericValue value, boolean doCacheClear)
          Remove a Generic Value from the database
 void rollback()
           
protected  void saveEntitySyncRemoveInfo(GenericEntity dummyPK)
           
 void setDistributedCacheClear(DistributedCacheClear distributedCacheClear)
           
 void setEntityCrypto(EntityCrypto crypto)
           
 void setEntityEcaHandler(EntityEcaHandler entityEcaHandler)
           
 void setNextSubSeqId(GenericValue value, java.lang.String seqFieldName, int numericPadding, int incrementBy)
          Look at existing values for a sub-entity with a sequenced secondary ID, and get the highest plus 1
 void setSequencer(SequenceUtil sequencer)
          Allows you to pass a SequenceUtil class (possibly one that overrides the getNextSeqId method); if null is passed will effectively refresh the sequencer.
 int store(GenericValue value)
          Store the Entity from the GenericValue to the persistent store
 int store(GenericValue value, boolean doCacheClear)
          Store the Entity from the GenericValue to the persistent store
 int storeAll(java.util.List<GenericValue> values)
          Store the Entities from the List GenericValue instances to the persistent store.
 int storeAll(java.util.List<GenericValue> values, boolean doCacheClear)
          Store the Entities from the List GenericValue instances to the persistent store.
 int storeAll(java.util.List<GenericValue> values, boolean doCacheClear, boolean createDummyFks)
          Store the Entities from the List GenericValue instances to the persistent store.
 int storeByCondition(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fieldsToSet, EntityCondition condition)
          Store a group of values
 int storeByCondition(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fieldsToSet, EntityCondition condition, boolean doCacheClear)
          Store a group of values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

module

public static final java.lang.String module

modelReader

protected ModelReader modelReader

modelGroupReader

protected ModelGroupReader modelGroupReader

alwaysUseTransaction

public static final boolean alwaysUseTransaction
This flag is only here for lower level technical testing, it shouldn't be user configurable (or at least I don't think so yet); when true all operations without a transaction will be wrapped in one; seems to be necessary for some (all?) XA aware connection pools, and should improve overall stability and consistency

See Also:
Constant Field Values

delegatorCache

protected static java.util.Map<java.lang.String,GenericDelegator> delegatorCache
the delegatorCache will now be a HashMap, allowing reload of definitions, but the delegator will always be the same object for the given name


delegatorName

protected java.lang.String delegatorName

delegatorInfo

protected DelegatorInfo delegatorInfo

cache

protected Cache cache

andCacheFieldSets

protected java.util.Map andCacheFieldSets
keeps a list of field key sets used in the by and cache, a Set (of Sets of fieldNames) for each entityName


distributedCacheClear

protected DistributedCacheClear distributedCacheClear

entityEcaHandler

protected EntityEcaHandler<?> entityEcaHandler

sequencer

protected SequenceUtil sequencer

crypto

protected EntityCrypto crypto

userIdentifierStack

protected static java.lang.ThreadLocal<java.util.List<java.lang.Object>> userIdentifierStack
A ThreadLocal variable to allow other methods to specify a user identifier (usually the userLoginId, though technically the Entity Engine doesn't know anything about the UserLogin entity)


sessionIdentifierStack

protected static java.lang.ThreadLocal<java.util.List<java.lang.Object>> sessionIdentifierStack
A ThreadLocal variable to allow other methods to specify a session identifier (usually the visitId, though technically the Entity Engine doesn't know anything about the Visit entity)

Constructor Detail

GenericDelegator

protected GenericDelegator()
Only allow creation through the factory method


GenericDelegator

protected GenericDelegator(java.lang.String delegatorName)
                    throws GenericEntityException
Only allow creation through the factory method

Throws:
GenericEntityException
Method Detail

getGenericDelegator

public static GenericDelegator getGenericDelegator(java.lang.String delegatorName)

getUserIdentifierStack

protected static java.util.List<java.lang.Object> getUserIdentifierStack()

getCurrentUserIdentifier

public static java.lang.String getCurrentUserIdentifier()

pushUserIdentifier

public static void pushUserIdentifier(java.lang.String userIdentifier)

popUserIdentifier

public static java.lang.String popUserIdentifier()

clearUserIdentifierStack

public static void clearUserIdentifierStack()

getSessionIdentifierStack

protected static java.util.List<java.lang.Object> getSessionIdentifierStack()

getCurrentSessionIdentifier

public static java.lang.String getCurrentSessionIdentifier()

pushSessionIdentifier

public static void pushSessionIdentifier(java.lang.String sessionIdentifier)

popSessionIdentifier

public static java.lang.String popSessionIdentifier()

clearSessionIdentifierStack

public static void clearSessionIdentifierStack()

initEntityEcaHandler

public void initEntityEcaHandler()

getDelegatorName

public java.lang.String getDelegatorName()
Specified by:
getDelegatorName in interface DelegatorInterface

getOriginalDelegatorName

public java.lang.String getOriginalDelegatorName()
Gets the name of the server configuration that corresponds to this delegator

Returns:
server configuration name

getDelegatorInfo

protected DelegatorInfo getDelegatorInfo()

getModelReader

public ModelReader getModelReader()
Gets the instance of ModelReader that corresponds to this delegator

Specified by:
getModelReader in interface DelegatorInterface
Returns:
ModelReader that corresponds to this delegator

getModelGroupReader

public ModelGroupReader getModelGroupReader()
Gets the instance of ModelGroupReader that corresponds to this delegator

Specified by:
getModelGroupReader in interface DelegatorInterface
Returns:
ModelGroupReader that corresponds to this delegator

getModelEntity

public ModelEntity getModelEntity(java.lang.String entityName)
Gets the instance of ModelEntity that corresponds to this delegator and the specified entityName

Specified by:
getModelEntity in interface DelegatorInterface
Parameters:
entityName - The name of the entity to get
Returns:
ModelEntity that corresponds to this delegator and the specified entityName

getEntityGroupName

public java.lang.String getEntityGroupName(java.lang.String entityName)
Gets the helper name that corresponds to this delegator and the specified entityName

Specified by:
getEntityGroupName in interface DelegatorInterface
Parameters:
entityName - The name of the entity to get the helper for
Returns:
String with the helper name that corresponds to this delegator and the specified entityName

getModelEntityMapByGroup

public java.util.Map<java.lang.String,ModelEntity> getModelEntityMapByGroup(java.lang.String groupName)
                                                                     throws GenericEntityException
Gets a Map of entity name & entity model pairs that are in the named group

Specified by:
getModelEntityMapByGroup in interface DelegatorInterface
Parameters:
groupName - The name of the group
Returns:
Map of entityName String keys and ModelEntity instance values
Throws:
GenericEntityException

getGroupHelperName

public java.lang.String getGroupHelperName(java.lang.String groupName)
Gets the helper name that corresponds to this delegator and the specified entityName

Specified by:
getGroupHelperName in interface DelegatorInterface
Parameters:
groupName - The name of the group to get the helper name for
Returns:
String with the helper name that corresponds to this delegator and the specified entityName

getEntityHelperName

public java.lang.String getEntityHelperName(java.lang.String entityName)
Gets the helper name that corresponds to this delegator and the specified entityName

Specified by:
getEntityHelperName in interface DelegatorInterface
Parameters:
entityName - The name of the entity to get the helper name for
Returns:
String with the helper name that corresponds to this delegator and the specified entityName

getEntityHelperName

public java.lang.String getEntityHelperName(ModelEntity entity)
Gets the helper name that corresponds to this delegator and the specified entity

Specified by:
getEntityHelperName in interface DelegatorInterface
Parameters:
entity - The entity to get the helper for
Returns:
String with the helper name that corresponds to this delegator and the specified entity

getEntityHelper

public GenericHelper getEntityHelper(java.lang.String entityName)
                              throws GenericEntityException
Gets the an instance of helper that corresponds to this delegator and the specified entityName

Specified by:
getEntityHelper in interface DelegatorInterface
Parameters:
entityName - The name of the entity to get the helper for
Returns:
GenericHelper that corresponds to this delegator and the specified entityName
Throws:
GenericEntityException

getEntityHelper

public GenericHelper getEntityHelper(ModelEntity entity)
                              throws GenericEntityException
Gets the an instance of helper that corresponds to this delegator and the specified entity

Specified by:
getEntityHelper in interface DelegatorInterface
Parameters:
entity - The entity to get the helper for
Returns:
GenericHelper that corresponds to this delegator and the specified entity
Throws:
GenericEntityException

getEntityFieldType

public ModelFieldType getEntityFieldType(ModelEntity entity,
                                         java.lang.String type)
                                  throws GenericEntityException
Gets a field type instance by name from the helper that corresponds to the specified entity

Specified by:
getEntityFieldType in interface DelegatorInterface
Parameters:
entity - The entity
type - The name of the type
Returns:
ModelFieldType instance for the named type from the helper that corresponds to the specified entity
Throws:
GenericEntityException

getEntityFieldTypeNames

public java.util.Collection<java.lang.String> getEntityFieldTypeNames(ModelEntity entity)
                                                               throws GenericEntityException
Gets field type names from the helper that corresponds to the specified entity

Specified by:
getEntityFieldTypeNames in interface DelegatorInterface
Parameters:
entity - The entity
Returns:
Collection of field type names from the helper that corresponds to the specified entity
Throws:
GenericEntityException

makeValue

public GenericValue makeValue(java.lang.String entityName)
Creates a Entity in the form of a GenericValue without persisting it

Specified by:
makeValue in interface DelegatorInterface

makeValue

public GenericValue makeValue(java.lang.String entityName,
                              java.lang.Object... fields)
Creates a Entity in the form of a GenericValue without persisting it

Specified by:
makeValue in interface DelegatorInterface

makeValue

public GenericValue makeValue(java.lang.String entityName,
                              java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Creates a Entity in the form of a GenericValue without persisting it

Specified by:
makeValue in interface DelegatorInterface

makeValueSingle

public GenericValue makeValueSingle(java.lang.String entityName,
                                    java.lang.Object singlePkValue)
Creates a Entity in the form of a GenericValue without persisting it

Specified by:
makeValueSingle in interface DelegatorInterface

makeValidValue

public GenericValue makeValidValue(java.lang.String entityName,
                                   java.lang.Object... fields)
Creates a Entity in the form of a GenericValue without persisting it; only valid fields will be pulled from the fields Map

Specified by:
makeValidValue in interface DelegatorInterface

makeValidValue

public GenericValue makeValidValue(java.lang.String entityName,
                                   java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Creates a Entity in the form of a GenericValue without persisting it; only valid fields will be pulled from the fields Map

Specified by:
makeValidValue in interface DelegatorInterface

makePK

public GenericPK makePK(java.lang.String entityName)
Creates a Primary Key in the form of a GenericPK without persisting it

Specified by:
makePK in interface DelegatorInterface

makePK

public GenericPK makePK(java.lang.String entityName,
                        java.lang.Object... fields)
Creates a Primary Key in the form of a GenericPK without persisting it

Specified by:
makePK in interface DelegatorInterface

makePK

public GenericPK makePK(java.lang.String entityName,
                        java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Creates a Primary Key in the form of a GenericPK without persisting it

Specified by:
makePK in interface DelegatorInterface

makePKSingle

public GenericPK makePKSingle(java.lang.String entityName,
                              java.lang.Object singlePkValue)
Creates a Primary Key in the form of a GenericPK without persisting it

Specified by:
makePKSingle in interface DelegatorInterface

create

public GenericValue create(GenericPK primaryKey)
                    throws GenericEntityException
Creates a Entity in the form of a GenericValue and write it to the datasource

Specified by:
create in interface DelegatorInterface
Parameters:
primaryKey - The GenericPK to create a value in the datasource from
Returns:
GenericValue instance containing the new instance
Throws:
GenericEntityException

create

public GenericValue create(GenericPK primaryKey,
                           boolean doCacheClear)
                    throws GenericEntityException
Creates a Entity in the form of a GenericValue and write it to the datasource

Specified by:
create in interface DelegatorInterface
Parameters:
primaryKey - The GenericPK to create a value in the datasource from
doCacheClear - boolean that specifies whether to clear related cache entries for this primaryKey to be created
Returns:
GenericValue instance containing the new instance
Throws:
GenericEntityException

create

public GenericValue create(java.lang.String entityName,
                           java.lang.Object... fields)
                    throws GenericEntityException
Creates a Entity in the form of a GenericValue and write it to the database

Specified by:
create in interface DelegatorInterface
Returns:
GenericValue instance containing the new instance
Throws:
GenericEntityException

create

public GenericValue create(java.lang.String entityName,
                           java.util.Map<java.lang.String,? extends java.lang.Object> fields)
                    throws GenericEntityException
Creates a Entity in the form of a GenericValue and write it to the database

Specified by:
create in interface DelegatorInterface
Returns:
GenericValue instance containing the new instance
Throws:
GenericEntityException

createSingle

public GenericValue createSingle(java.lang.String entityName,
                                 java.lang.Object singlePkValue)
                          throws GenericEntityException
Creates a Entity in the form of a GenericValue and write it to the database

Specified by:
createSingle in interface DelegatorInterface
Returns:
GenericValue instance containing the new instance
Throws:
GenericEntityException

create

public GenericValue create(GenericValue value)
                    throws GenericEntityException
Creates a Entity in the form of a GenericValue and write it to the datasource

Specified by:
create in interface DelegatorInterface
Parameters:
value - The GenericValue to create a value in the datasource from
Returns:
GenericValue instance containing the new instance
Throws:
GenericEntityException

createSetNextSeqId

public GenericValue createSetNextSeqId(GenericValue value)
                                throws GenericEntityException
Sets the sequenced ID (for entity with one primary key field ONLY), and then does a create in the database as normal. The reason to do it this way is that it will retry and fix the sequence if somehow the sequencer is in a bad state and returning a value that already exists.

Parameters:
value - The GenericValue to create a value in the datasource from
Returns:
GenericValue instance containing the new instance
Throws:
GenericEntityException

create

public GenericValue create(GenericValue value,
                           boolean doCacheClear)
                    throws GenericEntityException
Creates a Entity in the form of a GenericValue and write it to the datasource

Specified by:
create in interface DelegatorInterface
Parameters:
value - The GenericValue to create a value in the datasource from
doCacheClear - boolean that specifies whether or not to automatically clear cache entries related to this operation
Returns:
GenericValue instance containing the new instance
Throws:
GenericEntityException

createOrStore

public GenericValue createOrStore(GenericValue value,
                                  boolean doCacheClear)
                           throws GenericEntityException
Creates or stores an Entity

Specified by:
createOrStore in interface DelegatorInterface
Parameters:
value - The GenericValue instance containing the new or existing instance
doCacheClear - boolean that specifies whether or not to automatically clear cache entries related to this operation
Returns:
GenericValue instance containing the new or updated instance
Throws:
GenericEntityException

createOrStore

public GenericValue createOrStore(GenericValue value)
                           throws GenericEntityException
Creates or stores an Entity

Specified by:
createOrStore in interface DelegatorInterface
Parameters:
value - The GenericValue instance containing the new or existing instance
Returns:
GenericValue instance containing the new or updated instance
Throws:
GenericEntityException

saveEntitySyncRemoveInfo

protected void saveEntitySyncRemoveInfo(GenericEntity dummyPK)
                                 throws GenericEntityException
Throws:
GenericEntityException

removeByPrimaryKey

public int removeByPrimaryKey(GenericPK primaryKey)
                       throws GenericEntityException
Remove a Generic Entity corresponding to the primaryKey

Specified by:
removeByPrimaryKey in interface DelegatorInterface
Parameters:
primaryKey - The primary key of the entity to remove.
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeByPrimaryKey

public int removeByPrimaryKey(GenericPK primaryKey,
                              boolean doCacheClear)
                       throws GenericEntityException
Remove a Generic Entity corresponding to the primaryKey

Specified by:
removeByPrimaryKey in interface DelegatorInterface
Parameters:
primaryKey - The primary key of the entity to remove.
doCacheClear - boolean that specifies whether to clear cache entries for this primaryKey to be removed
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeValue

public int removeValue(GenericValue value)
                throws GenericEntityException
Remove a Generic Value from the database

Specified by:
removeValue in interface DelegatorInterface
Parameters:
value - The GenericValue object of the entity to remove.
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeValue

public int removeValue(GenericValue value,
                       boolean doCacheClear)
                throws GenericEntityException
Remove a Generic Value from the database

Specified by:
removeValue in interface DelegatorInterface
Parameters:
value - The GenericValue object of the entity to remove.
doCacheClear - boolean that specifies whether to clear cache entries for this value to be removed
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeByAnd

public int removeByAnd(java.lang.String entityName,
                       java.lang.Object... fields)
                throws GenericEntityException
Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND)

Specified by:
removeByAnd in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeByAnd

public int removeByAnd(java.lang.String entityName,
                       java.util.Map<java.lang.String,? extends java.lang.Object> fields)
                throws GenericEntityException
Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND)

Specified by:
removeByAnd in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeByAnd

public int removeByAnd(java.lang.String entityName,
                       boolean doCacheClear,
                       java.lang.Object... fields)
                throws GenericEntityException
Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND)

Specified by:
removeByAnd in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
doCacheClear - boolean that specifies whether to clear cache entries for this value to be removed
fields - The fields of the named entity to query by with their corresponging values
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeByAnd

public int removeByAnd(java.lang.String entityName,
                       java.util.Map<java.lang.String,? extends java.lang.Object> fields,
                       boolean doCacheClear)
                throws GenericEntityException
Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND)

Specified by:
removeByAnd in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
doCacheClear - boolean that specifies whether to clear cache entries for this value to be removed
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeByCondition

public int removeByCondition(java.lang.String entityName,
                             EntityCondition condition)
                      throws GenericEntityException
Removes/deletes Generic Entity records found by the condition

Specified by:
removeByCondition in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
condition - The condition used to restrict the removing
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeByCondition

public int removeByCondition(java.lang.String entityName,
                             EntityCondition condition,
                             boolean doCacheClear)
                      throws GenericEntityException
Removes/deletes Generic Entity records found by the condition

Specified by:
removeByCondition in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
condition - The condition used to restrict the removing
doCacheClear - boolean that specifies whether to clear cache entries for this value to be removed
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeRelated

public int removeRelated(java.lang.String relationName,
                         GenericValue value)
                  throws GenericEntityException
Remove the named Related Entity for the GenericValue from the persistent store

Specified by:
removeRelated in interface DelegatorInterface
Parameters:
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
value - GenericValue instance containing the entity
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeRelated

public int removeRelated(java.lang.String relationName,
                         GenericValue value,
                         boolean doCacheClear)
                  throws GenericEntityException
Remove the named Related Entity for the GenericValue from the persistent store

Specified by:
removeRelated in interface DelegatorInterface
Parameters:
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
value - GenericValue instance containing the entity
doCacheClear - boolean that specifies whether to clear cache entries for this value to be removed
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

refresh

public void refresh(GenericValue value)
             throws GenericEntityException
Refresh the Entity for the GenericValue from the persistent store

Specified by:
refresh in interface DelegatorInterface
Parameters:
value - GenericValue instance containing the entity to refresh
Throws:
GenericEntityException

refresh

public void refresh(GenericValue value,
                    boolean doCacheClear)
             throws GenericEntityException
Refresh the Entity for the GenericValue from the persistent store

Specified by:
refresh in interface DelegatorInterface
Parameters:
value - GenericValue instance containing the entity to refresh
doCacheClear - boolean that specifies whether or not to automatically clear cache entries related to this operation
Throws:
GenericEntityException

refreshFromCache

public void refreshFromCache(GenericValue value)
                      throws GenericEntityException
Refresh the Entity for the GenericValue from the cache

Parameters:
value - GenericValue instance containing the entity to refresh
Throws:
GenericEntityException

storeByCondition

public int storeByCondition(java.lang.String entityName,
                            java.util.Map<java.lang.String,? extends java.lang.Object> fieldsToSet,
                            EntityCondition condition)
                     throws GenericEntityException
Store a group of values

Specified by:
storeByCondition in interface DelegatorInterface
Parameters:
entityName - The name of the Entity as defined in the entity XML file
fieldsToSet - The fields of the named entity to set in the database
condition - The condition that restricts the list of stored values
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

storeByCondition

public int storeByCondition(java.lang.String entityName,
                            java.util.Map<java.lang.String,? extends java.lang.Object> fieldsToSet,
                            EntityCondition condition,
                            boolean doCacheClear)
                     throws GenericEntityException
Store a group of values

Specified by:
storeByCondition in interface DelegatorInterface
Parameters:
entityName - The name of the Entity as defined in the entity XML file
fieldsToSet - The fields of the named entity to set in the database
condition - The condition that restricts the list of stored values
doCacheClear - boolean that specifies whether to clear cache entries for these values
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

store

public int store(GenericValue value)
          throws GenericEntityException
Store the Entity from the GenericValue to the persistent store

Specified by:
store in interface DelegatorInterface
Parameters:
value - GenericValue instance containing the entity
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

store

public int store(GenericValue value,
                 boolean doCacheClear)
          throws GenericEntityException
Store the Entity from the GenericValue to the persistent store

Specified by:
store in interface DelegatorInterface
Parameters:
value - GenericValue instance containing the entity
doCacheClear - boolean that specifies whether or not to automatically clear cache entries related to this operation
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

storeAll

public int storeAll(java.util.List<GenericValue> values)
             throws GenericEntityException
Store the Entities from the List GenericValue instances to the persistent store.
This is different than the normal store method in that the store method only does an update, while the storeAll method checks to see if each entity exists, then either does an insert or an update as appropriate.
These updates all happen in one transaction, so they will either all succeed or all fail, if the data source supports transactions. This is just like to othersToStore feature of the GenericEntity on a create or store.

Specified by:
storeAll in interface DelegatorInterface
Parameters:
values - List of GenericValue instances containing the entities to store
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

storeAll

public int storeAll(java.util.List<GenericValue> values,
                    boolean doCacheClear)
             throws GenericEntityException
Store the Entities from the List GenericValue instances to the persistent store.
This is different than the normal store method in that the store method only does an update, while the storeAll method checks to see if each entity exists, then either does an insert or an update as appropriate.
These updates all happen in one transaction, so they will either all succeed or all fail, if the data source supports transactions. This is just like to othersToStore feature of the GenericEntity on a create or store.

Specified by:
storeAll in interface DelegatorInterface
Parameters:
values - List of GenericValue instances containing the entities to store
doCacheClear - boolean that specifies whether or not to automatically clear cache entries related to this operation
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

storeAll

public int storeAll(java.util.List<GenericValue> values,
                    boolean doCacheClear,
                    boolean createDummyFks)
             throws GenericEntityException
Store the Entities from the List GenericValue instances to the persistent store.
This is different than the normal store method in that the store method only does an update, while the storeAll method checks to see if each entity exists, then either does an insert or an update as appropriate.
These updates all happen in one transaction, so they will either all succeed or all fail, if the data source supports transactions. This is just like to othersToStore feature of the GenericEntity on a create or store.

Parameters:
values - List of GenericValue instances containing the entities to store
doCacheClear - boolean that specifies whether or not to automatically clear cache entries related to this operation
createDummyFks - boolean that specifies whether or not to automatically create "dummy" place holder FKs
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeAll

public int removeAll(java.lang.String entityName)
              throws GenericEntityException
Specified by:
removeAll in interface DelegatorInterface
Throws:
GenericEntityException

removeAll

public int removeAll(java.util.List<? extends GenericEntity> dummyPKs)
              throws GenericEntityException
Remove the Entities from the List from the persistent store.
The List contains GenericEntity objects, can be either GenericPK or GenericValue.
If a certain entity contains a complete primary key, the entity in the datasource corresponding to that primary key will be removed, this is like a removeByPrimary Key.
On the other hand, if a certain entity is an incomplete or non primary key, if will behave like the removeByAnd method.
These updates all happen in one transaction, so they will either all succeed or all fail, if the data source supports transactions.

Specified by:
removeAll in interface DelegatorInterface
Parameters:
dummyPKs - Collection of GenericEntity instances containing the entities or by and fields to remove
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

removeAll

public int removeAll(java.util.List<? extends GenericEntity> dummyPKs,
                     boolean doCacheClear)
              throws GenericEntityException
Remove the Entities from the List from the persistent store.
The List contains GenericEntity objects, can be either GenericPK or GenericValue.
If a certain entity contains a complete primary key, the entity in the datasource corresponding to that primary key will be removed, this is like a removeByPrimary Key.
On the other hand, if a certain entity is an incomplete or non primary key, if will behave like the removeByAnd method.
These updates all happen in one transaction, so they will either all succeed or all fail, if the data source supports transactions.

Specified by:
removeAll in interface DelegatorInterface
Parameters:
dummyPKs - Collection of GenericEntity instances containing the entities or by and fields to remove
doCacheClear - boolean that specifies whether or not to automatically clear cache entries related to this operation
Returns:
int representing number of rows effected by this operation
Throws:
GenericEntityException

findOne

public GenericValue findOne(java.lang.String entityName,
                            boolean useCache,
                            java.lang.Object... fields)
                     throws GenericEntityException
Find a Generic Entity by its Primary Key NOTE 20080502: 6 references

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
The GenericValue corresponding to the primaryKey
Throws:
GenericEntityException

findOne

public GenericValue findOne(java.lang.String entityName,
                            java.util.Map<java.lang.String,? extends java.lang.Object> fields,
                            boolean useCache)
                     throws GenericEntityException
Find a Generic Entity by its Primary Key NOTE 20080502: 6 references

Specified by:
findOne in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
The GenericValue corresponding to the primaryKey
Throws:
GenericEntityException

findByPrimaryKey

public GenericValue findByPrimaryKey(GenericPK primaryKey)
                              throws GenericEntityException
Find a Generic Entity by its Primary Key NOTE 20080502: 15 references; all changed to findOne

Parameters:
primaryKey - The primary key to find by.
Returns:
The GenericValue corresponding to the primaryKey
Throws:
GenericEntityException

findByPrimaryKeyCache

public GenericValue findByPrimaryKeyCache(GenericPK primaryKey)
                                   throws GenericEntityException
Find a CACHED Generic Entity by its Primary Key NOTE 20080502: 2 references; all changed to findOne

Parameters:
primaryKey - The primary key to find by.
Returns:
The GenericValue corresponding to the primaryKey
Throws:
GenericEntityException

findByPrimaryKey

public GenericValue findByPrimaryKey(java.lang.String entityName,
                                     java.lang.Object... fields)
                              throws GenericEntityException
Find a Generic Entity by its Primary Key NOTE 20080502: 21 references; all changed to findOne

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
The GenericValue corresponding to the primaryKey
Throws:
GenericEntityException

findByPrimaryKey

public GenericValue findByPrimaryKey(java.lang.String entityName,
                                     java.util.Map<java.lang.String,? extends java.lang.Object> fields)
                              throws GenericEntityException
Find a Generic Entity by its Primary Key NOTE 20080502: 550 references (20080503 521 left); needs to be deprecated, should use findOne instead, but lots of stuff to replace!

Specified by:
findByPrimaryKey in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
The GenericValue corresponding to the primaryKey
Throws:
GenericEntityException

findByPrimaryKeySingle

public GenericValue findByPrimaryKeySingle(java.lang.String entityName,
                                           java.lang.Object singlePkValue)
                                    throws GenericEntityException
Find a Generic Entity by its Primary Key NOTE 20080502: 0 references

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
singlePkValue -
Returns:
The GenericValue corresponding to the primaryKey
Throws:
GenericEntityException

findByPrimaryKeyCache

public GenericValue findByPrimaryKeyCache(java.lang.String entityName,
                                          java.lang.Object... fields)
                                   throws GenericEntityException
Find a CACHED Generic Entity by its Primary Key NOTE 20080502: 2 references

Specified by:
findByPrimaryKeyCache in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
The GenericValue corresponding to the primaryKey
Throws:
GenericEntityException

findByPrimaryKeyCache

public GenericValue findByPrimaryKeyCache(java.lang.String entityName,
                                          java.util.Map<java.lang.String,? extends java.lang.Object> fields)
                                   throws GenericEntityException
Find a CACHED Generic Entity by its Primary Key NOTE 20080502: 218 references

Specified by:
findByPrimaryKeyCache in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
The GenericValue corresponding to the primaryKey
Throws:
GenericEntityException

findByPrimaryKeyCacheSingle

public GenericValue findByPrimaryKeyCacheSingle(java.lang.String entityName,
                                                java.lang.Object singlePkValue)
                                         throws GenericEntityException
Find a CACHED Generic Entity by its Primary Key NOTE 20080502: 0 references

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
singlePkValue -
Returns:
The GenericValue corresponding to the primaryKey
Throws:
GenericEntityException

findByPrimaryKeyPartial

public GenericValue findByPrimaryKeyPartial(GenericPK primaryKey,
                                            java.lang.String... keys)
                                     throws GenericEntityException
Find a Generic Entity by its Primary Key and only returns the values requested by the passed keys (names) NOTE 20080502: 0 references

Parameters:
primaryKey - The primary key to find by.
keys - The keys, or names, of the values to retrieve; only these values will be retrieved
Returns:
The GenericValue corresponding to the primaryKey
Throws:
GenericEntityException

findByPrimaryKeyPartial

public GenericValue findByPrimaryKeyPartial(GenericPK primaryKey,
                                            java.util.Set<java.lang.String> keys)
                                     throws GenericEntityException
Find a Generic Entity by its Primary Key and only returns the values requested by the passed keys (names) NOTE 20080502: 3 references

Specified by:
findByPrimaryKeyPartial in interface DelegatorInterface
Parameters:
primaryKey - The primary key to find by.
keys - The keys, or names, of the values to retrieve; only these values will be retrieved
Returns:
The GenericValue corresponding to the primaryKey
Throws:
GenericEntityException

findAllByPrimaryKeys

public java.util.List<GenericValue> findAllByPrimaryKeys(java.util.Collection<GenericPK> primaryKeys)
                                                  throws GenericEntityException
Find a number of Generic Value objects by their Primary Keys, all at once NOTE 20080502: 0 references

Parameters:
primaryKeys - A Collection of primary keys to find by.
Returns:
List of GenericValue objects corresponding to the passed primaryKey objects
Throws:
GenericEntityException

findAllByPrimaryKeysCache

public java.util.List<GenericValue> findAllByPrimaryKeysCache(java.util.Collection<GenericPK> primaryKeys)
                                                       throws GenericEntityException
Find a number of Generic Value objects by their Primary Keys, all at once; this first looks in the local cache for each PK and if there then it puts it in the return list rather than putting it in the batch to send to a given helper. NOTE 20080502: 0 references

Parameters:
primaryKeys - A Collection of primary keys to find by.
Returns:
List of GenericValue objects corresponding to the passed primaryKey objects
Throws:
GenericEntityException

findAll

public java.util.List<GenericValue> findAll(java.lang.String entityName)
                                     throws GenericEntityException
Finds all Generic entities NOTE 20080502: 14 references; all changed to findList

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
Returns:
List containing all Generic entities
Throws:
GenericEntityException

findAll

public java.util.List<GenericValue> findAll(java.lang.String entityName,
                                            java.lang.String... orderBy)
                                     throws GenericEntityException
Finds all Generic entities NOTE 20080502: 0 references

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
List containing all Generic entities
Throws:
GenericEntityException

findAll

public java.util.List<GenericValue> findAll(java.lang.String entityName,
                                            java.util.List<java.lang.String> orderBy)
                                     throws GenericEntityException
Finds all Generic entities NOTE 20080502: 10 references; all changed to findList

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
List containing all Generic entities
Throws:
GenericEntityException

findAllCache

public java.util.List<GenericValue> findAllCache(java.lang.String entityName)
                                          throws GenericEntityException
Finds all Generic entities, looking first in the cache NOTE 20080502: 4 references; all changed to findList

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
Returns:
List containing all Generic entities
Throws:
GenericEntityException

findAllCache

public java.util.List<GenericValue> findAllCache(java.lang.String entityName,
                                                 java.lang.String... orderBy)
                                          throws GenericEntityException
Finds all Generic entities, looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields NOTE 20080502: 0 references

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
List containing all Generic entities
Throws:
GenericEntityException

findAllCache

public java.util.List<GenericValue> findAllCache(java.lang.String entityName,
                                                 java.util.List<java.lang.String> orderBy)
                                          throws GenericEntityException
Finds all Generic entities, looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields NOTE 20080502: 2 references; all changed to findList

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
List containing all Generic entities
Throws:
GenericEntityException

findByAnd

@Deprecated
public java.util.List<GenericValue> findByAnd(java.lang.String entityName,
                                                         java.lang.Object... fields)
                                       throws GenericEntityException
Deprecated. 

Finds Generic Entity records by all of the specified fields (ie: combined using AND) NOTE 20080502: 1 references

Specified by:
findByAnd in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByAnd

public java.util.List<GenericValue> findByAnd(java.lang.String entityName,
                                              java.util.Map<java.lang.String,? extends java.lang.Object> fields)
                                       throws GenericEntityException
Finds Generic Entity records by all of the specified fields (ie: combined using AND) NOTE 20080502: 264 references

Specified by:
findByAnd in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByOr

@Deprecated
public java.util.List<GenericValue> findByOr(java.lang.String entityName,
                                                        java.lang.Object... fields)
                                      throws GenericEntityException
Deprecated. 

Finds Generic Entity records by all of the specified fields (ie: combined using OR) NOTE 20080502: 0 references

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByOr

public java.util.List<GenericValue> findByOr(java.lang.String entityName,
                                             java.util.Map<java.lang.String,? extends java.lang.Object> fields)
                                      throws GenericEntityException
Finds Generic Entity records by all of the specified fields (ie: combined using OR) NOTE 20080502: 1 references; all changed to findList

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByAnd

public java.util.List<GenericValue> findByAnd(java.lang.String entityName,
                                              java.util.Map<java.lang.String,? extends java.lang.Object> fields,
                                              java.util.List<java.lang.String> orderBy)
                                       throws GenericEntityException
Finds Generic Entity records by all of the specified fields (ie: combined using AND) NOTE 20080502: 72 references

Specified by:
findByAnd in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByOr

public java.util.List<GenericValue> findByOr(java.lang.String entityName,
                                             java.util.Map<java.lang.String,? extends java.lang.Object> fields,
                                             java.util.List<java.lang.String> orderBy)
                                      throws GenericEntityException
Finds Generic Entity records by all of the specified fields (ie: combined using OR) NOTE 20080502: 1 references; all changed to findList

Specified by:
findByOr in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByAndCache

public java.util.List<GenericValue> findByAndCache(java.lang.String entityName,
                                                   java.lang.Object... fields)
                                            throws GenericEntityException
Finds Generic Entity records by all of the specified fields (ie: combined using AND), looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields NOTE 20080502: 0 references

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByAndCache

public java.util.List<GenericValue> findByAndCache(java.lang.String entityName,
                                                   java.util.Map<java.lang.String,? extends java.lang.Object> fields)
                                            throws GenericEntityException
Finds Generic Entity records by all of the specified fields (ie: combined using AND), looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields NOTE 20080502: 91 references

Specified by:
findByAndCache in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByAndCache

public java.util.List<GenericValue> findByAndCache(java.lang.String entityName,
                                                   java.util.Map<java.lang.String,? extends java.lang.Object> fields,
                                                   java.util.List<java.lang.String> orderBy)
                                            throws GenericEntityException
Finds Generic Entity records by all of the specified fields (ie: combined using AND), looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields NOTE 20080502: 56 references

Specified by:
findByAndCache in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByAnd

public <T extends EntityCondition> java.util.List<GenericValue> findByAnd(java.lang.String entityName,
                                                                          T... expressions)
                                       throws GenericEntityException
Finds Generic Entity records by all of the specified expressions (ie: combined using AND) NOTE 20080502: 0 references

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
expressions - The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByAnd

public <T extends EntityCondition> java.util.List<GenericValue> findByAnd(java.lang.String entityName,
                                                                          java.util.List<T> expressions)
                                       throws GenericEntityException
Finds Generic Entity records by all of the specified expressions (ie: combined using AND) NOTE 20080502: 11 references; all changed to findList

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
expressions - The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByAnd

public <T extends EntityCondition> java.util.List<GenericValue> findByAnd(java.lang.String entityName,
                                                                          java.util.List<T> expressions,
                                                                          java.util.List<java.lang.String> orderBy)
                                       throws GenericEntityException
Finds Generic Entity records by all of the specified expressions (ie: combined using AND) NOTE 20080502: 24 references; all changed to findList

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
expressions - The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByOr

public <T extends EntityCondition> java.util.List<GenericValue> findByOr(java.lang.String entityName,
                                                                         T... expressions)
                                      throws GenericEntityException
Finds Generic Entity records by all of the specified expressions (ie: combined using OR) NOTE 20080502: 0 references

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
expressions - The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByOr

public <T extends EntityCondition> java.util.List<GenericValue> findByOr(java.lang.String entityName,
                                                                         java.util.List<T> expressions)
                                      throws GenericEntityException
Finds Generic Entity records by all of the specified expressions (ie: combined using OR) NOTE 20080502: 2 references; all changed to findList

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
expressions - The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByOr

public <T extends EntityCondition> java.util.List<GenericValue> findByOr(java.lang.String entityName,
                                                                         java.util.List<T> expressions,
                                                                         java.util.List<java.lang.String> orderBy)
                                      throws GenericEntityException
Finds Generic Entity records by all of the specified expressions (ie: combined using OR) NOTE 20080502: 0 references

Parameters:
entityName - The Name of the Entity as defined in the entity XML file
expressions - The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
List of GenericValue instances that match the query
Throws:
GenericEntityException

findByLike

public java.util.List<GenericValue> findByLike(java.lang.String entityName,
                                               java.lang.Object... fields)
                                        throws GenericEntityException
NOTE 20080502: 0 references

Throws:
GenericEntityException

findByLike

public java.util.List<GenericValue> findByLike(java.lang.String entityName,
                                               java.util.Map<java.lang.String,? extends java.lang.Object> fields)
                                        throws GenericEntityException
NOTE 20080502: 1 references; all changed to findList

Throws:
GenericEntityException

findByLike

public java.util.List<GenericValue> findByLike(java.lang.String entityName,
                                               java.util.Map<java.lang.String,? extends java.lang.Object> fields,
                                               java.util.List<java.lang.String> orderBy)
                                        throws GenericEntityException
NOTE 20080502: 1 references; all changed to findList

Throws:
GenericEntityException

findByCondition

public java.util.List<GenericValue> findByCondition(java.lang.String entityName,
                                                    EntityCondition entityCondition,
                                                    java.util.Collection<java.lang.String> fieldsToSelect,
                                                    java.util.List<java.lang.String> orderBy)
                                             throws GenericEntityException
Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details. NOTE 20080502: 64 references; all changed to findList

Parameters:
entityName - The Name of the Entity as defined in the entity model XML file
entityCondition - The EntityCondition object that specifies how to constrain this query
fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
List of GenericValue objects representing the result
Throws:
GenericEntityException

findByCondition

public java.util.List<GenericValue> findByCondition(java.lang.String entityName,
                                                    EntityCondition whereEntityCondition,
                                                    EntityCondition havingEntityCondition,
                                                    java.util.Collection<java.lang.String> fieldsToSelect,
                                                    java.util.List<java.lang.String> orderBy,
                                                    EntityFindOptions findOptions)
                                             throws GenericEntityException
Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details. NOTE 20080502: 6 references; all changed to findList

Parameters:
entityName - The name of the Entity as defined in the entity XML file
whereEntityCondition - The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases)
havingEntityCondition - The EntityCondition object that specifies how to constrain this query after any groupings are done (if this is a view entity with group-by aliases)
fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
findOptions - An instance of EntityFindOptions that specifies advanced query options. See the EntityFindOptions JavaDoc for more details.
Returns:
List of GenericValue objects representing the result
Throws:
GenericEntityException

findByConditionCache

public java.util.List<GenericValue> findByConditionCache(java.lang.String entityName,
                                                         EntityCondition entityCondition,
                                                         java.util.Collection<java.lang.String> fieldsToSelect,
                                                         java.util.List<java.lang.String> orderBy)
                                                  throws GenericEntityException
Finds GenericValues by the conditions specified in the EntityCondition object, looking first in the cache, see the EntityCondition javadoc for more details. NOTE 20080502: 17 references; all changed to findList

Parameters:
entityName - The Name of the Entity as defined in the entity model XML file
entityCondition - The EntityCondition object that specifies how to constrain this query
fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
List of GenericValue objects representing the result
Throws:
GenericEntityException

findListIteratorByCondition

public EntityListIterator findListIteratorByCondition(java.lang.String entityName,
                                                      EntityCondition entityCondition,
                                                      java.util.Collection<java.lang.String> fieldsToSelect,
                                                      java.util.List<java.lang.String> orderBy)
                                               throws GenericEntityException
Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details. NOTE 20080502: 26 references; all changed to find

Parameters:
entityName - The Name of the Entity as defined in the entity model XML file
entityCondition - The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases)
fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
EntityListIterator representing the result of the query: NOTE THAT THIS MUST BE CLOSED WHEN YOU ARE DONE WITH IT, AND DON'T LEAVE IT OPEN TOO LONG BEACUSE IT WILL MAINTAIN A DATABASE CONNECTION.
Throws:
GenericEntityException

findListIteratorByCondition

public EntityListIterator findListIteratorByCondition(java.lang.String entityName,
                                                      EntityCondition whereEntityCondition,
                                                      EntityCondition havingEntityCondition,
                                                      java.util.Collection<java.lang.String> fieldsToSelect,
                                                      java.util.List<java.lang.String> orderBy,
                                                      EntityFindOptions findOptions)
                                               throws GenericEntityException
Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details. NOTE 20080502: 12 references; all changed to find

Parameters:
entityName - The name of the Entity as defined in the entity XML file
whereEntityCondition - The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases)
havingEntityCondition - The EntityCondition object that specifies how to constrain this query after any groupings are done (if this is a view entity with group-by aliases)
fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
findOptions - An instance of EntityFindOptions that specifies advanced query options. See the EntityFindOptions JavaDoc for more details.
Returns:
EntityListIterator representing the result of the query: NOTE THAT THIS MUST BE CLOSED WHEN YOU ARE DONE WITH IT, AND DON'T LEAVE IT OPEN TOO LONG BEACUSE IT WILL MAINTAIN A DATABASE CONNECTION.
Throws:
GenericEntityException

find

public EntityListIterator find(java.lang.String entityName,
                               EntityCondition whereEntityCondition,
                               EntityCondition havingEntityCondition,
                               java.util.Set<java.lang.String> fieldsToSelect,
                               java.util.List<java.lang.String> orderBy,
                               EntityFindOptions findOptions)
                        throws GenericEntityException
Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details. NOTE 20080502: 3 references

Specified by:
find in interface DelegatorInterface
Parameters:
entityName - The name of the Entity as defined in the entity XML file
whereEntityCondition - The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases)
havingEntityCondition - The EntityCondition object that specifies how to constrain this query after any groupings are done (if this is a view entity with group-by aliases)
fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
findOptions - An instance of EntityFindOptions that specifies advanced query options. See the EntityFindOptions JavaDoc for more details.
Returns:
EntityListIterator representing the result of the query: NOTE THAT THIS MUST BE CLOSED (preferably in a finally block) WHEN YOU ARE DONE WITH IT, AND DON'T LEAVE IT OPEN TOO LONG BEACUSE IT WILL MAINTAIN A DATABASE CONNECTION.
Throws:
GenericEntityException

findList

public java.util.List<GenericValue> findList(java.lang.String entityName,
                                             EntityCondition entityCondition,
                                             java.util.Set<java.lang.String> fieldsToSelect,
                                             java.util.List<java.lang.String> orderBy,
                                             EntityFindOptions findOptions,
                                             boolean useCache)
                                      throws GenericEntityException
Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details. NOTE 20080502: 12 references

Specified by:
findList in interface DelegatorInterface
Parameters:
entityName - The name of the Entity as defined in the entity XML file
entityCondition - The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases)
fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
findOptions - An instance of EntityFindOptions that specifies advanced query options. See the EntityFindOptions JavaDoc for more details.
Returns:
List of GenericValue objects representing the result
Throws:
GenericEntityException

findListIteratorByCondition

public EntityListIterator findListIteratorByCondition(DynamicViewEntity dynamicViewEntity,
                                                      EntityCondition whereEntityCondition,
                                                      EntityCondition havingEntityCondition,
                                                      java.util.Collection<java.lang.String> fieldsToSelect,
                                                      java.util.List<java.lang.String> orderBy,
                                                      EntityFindOptions findOptions)
                                               throws GenericEntityException
Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details. NOTE 20080502: 9 references

Parameters:
dynamicViewEntity - The DynamicViewEntity to use for the entity model for this query; generally created on the fly for limited use
whereEntityCondition - The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases)
havingEntityCondition - The EntityCondition object that specifies how to constrain this query after any groupings are done (if this is a view entity with group-by aliases)
fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived
orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
findOptions - An instance of EntityFindOptions that specifies advanced query options. See the EntityFindOptions JavaDoc for more details.
Returns:
EntityListIterator representing the result of the query: NOTE THAT THIS MUST BE CLOSED WHEN YOU ARE DONE WITH IT, AND DON'T LEAVE IT OPEN TOO LONG BEACUSE IT WILL MAINTAIN A DATABASE CONNECTION.
Throws:
GenericEntityException

findCountByAnd

public long findCountByAnd(java.lang.String entityName)
                    throws GenericEntityException
NOTE 20080502: 3 references; all changed to findCoundByCondition

Throws:
GenericEntityException

findCountByAnd

public long findCountByAnd(java.lang.String entityName,
                           java.lang.Object... fields)
                    throws GenericEntityException
NOTE 20080502: 1 references; all changed to use findCountByCondition

Throws:
GenericEntityException

findCountByAnd

public long findCountByAnd(java.lang.String entityName,
                           java.util.Map<java.lang.String,? extends java.lang.Object> fields)
                    throws GenericEntityException
NOTE 20080502: 8 references; all changed to use findCountByCondition

Throws:
GenericEntityException

findCountByCondition

public long findCountByCondition(java.lang.String entityName,
                                 EntityCondition whereEntityCondition,
                                 EntityCondition havingEntityCondition)
                          throws GenericEntityException
NOTE 20080502: 17 references; all changed to use remaining findCountByCondition

Throws:
GenericEntityException

findCountByCondition

public long findCountByCondition(java.lang.String entityName,
                                 EntityCondition whereEntityCondition,
                                 EntityCondition havingEntityCondition,
                                 EntityFindOptions findOptions)
                          throws GenericEntityException
NOTE 20080502: 2 references

Throws:
GenericEntityException

getMultiRelation

public java.util.List<GenericValue> getMultiRelation(GenericValue value,
                                                     java.lang.String relationNameOne,
                                                     java.lang.String relationNameTwo,
                                                     java.util.List<java.lang.String> orderBy)
                                              throws GenericEntityException
Get the named Related Entity for the GenericValue from the persistent store across another Relation. Helps to get related Values in a multi-to-multi relationship. NOTE 20080502: 3 references

Specified by:
getMultiRelation in interface DelegatorInterface
Parameters:
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 relation
relationNameTwo - String containing the relation name for second relation
value - GenericValue instance containing the entity
orderBy - The fields of the named entity to order the query by; may be null; optionally add a " ASC" for ascending or " DESC" for descending
Returns:
List of GenericValue instances as specified in the relation definition
Throws:
GenericEntityException

getMultiRelation

public java.util.List<GenericValue> getMultiRelation(GenericValue value,
                                                     java.lang.String relationNameOne,
                                                     java.lang.String relationNameTwo)
                                              throws GenericEntityException
Get the named Related Entity for the GenericValue from the persistent store across another Relation. Helps to get related Values in a multi-to-multi relationship. NOTE 20080502: 0 references

Parameters:
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 relation
relationNameTwo - String containing the relation name for second relation
value - GenericValue instance containing the entity
Returns:
List of GenericValue instances as specified in the relation definition
Throws:
GenericEntityException

getRelated

public java.util.List<GenericValue> getRelated(java.lang.String relationName,
                                               GenericValue value)
                                        throws GenericEntityException
Get the named Related Entity for the GenericValue from the persistent store NOTE 20080502: 1 references; all changed to use remaining getRelated

Parameters:
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
value - GenericValue instance containing the entity
Returns:
List of GenericValue instances as specified in the relation definition
Throws:
GenericEntityException

getRelatedByAnd

public java.util.List<GenericValue> getRelatedByAnd(java.lang.String relationName,
                                                    java.util.Map<java.lang.String,? extends java.lang.Object> byAndFields,
                                                    GenericValue value)
                                             throws GenericEntityException
Get the named Related Entity for the GenericValue from the persistent store NOTE 20080502: 1 references; all changed to use getRelated

Parameters:
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
byAndFields - the fields that must equal in order to keep; may be null
value - GenericValue instance containing the entity
Returns:
List of GenericValue instances as specified in the relation definition
Throws:
GenericEntityException

getRelatedOrderBy

public java.util.List<GenericValue> getRelatedOrderBy(java.lang.String relationName,
                                                      java.util.List<java.lang.String> orderBy,
                                                      GenericValue value)
                                               throws GenericEntityException
Get the named Related Entity for the GenericValue from the persistent store NOTE 20080502: 1 references; all changed to use getRelated

Parameters:
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
orderBy - The fields of the named entity to order the query by; may be null; optionally add a " ASC" for ascending or " DESC" for descending
value - GenericValue instance containing the entity
Returns:
List of GenericValue instances as specified in the relation definition
Throws:
GenericEntityException

getRelated

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,
                                               GenericValue value)
                                        throws GenericEntityException
Get the named Related Entity for the GenericValue from the persistent store NOTE 20080502: 5 references

Specified by:
getRelated in interface DelegatorInterface
Parameters:
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
byAndFields - the fields that must equal in order to keep; may be null
orderBy - The fields of the named entity to order the query by; may be null; optionally add a " ASC" for ascending or " DESC" for descending
value - GenericValue instance containing the entity
Returns:
List of GenericValue instances as specified in the relation definition
Throws:
GenericEntityException

getRelatedDummyPK

public GenericPK getRelatedDummyPK(java.lang.String relationName,
                                   java.util.Map<java.lang.String,? extends java.lang.Object> byAndFields,
                                   GenericValue value)
                            throws GenericEntityException
Get a dummy primary key for the named Related Entity for the GenericValue NOTE 20080502: 2 references

Specified by:
getRelatedDummyPK in interface DelegatorInterface
Parameters:
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
byAndFields - the fields that must equal in order to keep; may be null
value - GenericValue instance containing the entity
Returns:
GenericPK containing a possibly incomplete PrimaryKey object representing the related entity or entities
Throws:
GenericEntityException

getRelatedCache

public java.util.List<GenericValue> getRelatedCache(java.lang.String relationName,
                                                    GenericValue value)
                                             throws GenericEntityException
Get the named Related Entity for the GenericValue from the persistent store, checking first in the cache to see if the desired value is there NOTE 20080502: 4 references

Specified by:
getRelatedCache in interface DelegatorInterface
Parameters:
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
value - GenericValue instance containing the entity
Returns:
List of GenericValue instances as specified in the relation definition
Throws:
GenericEntityException

getRelatedOne

public GenericValue getRelatedOne(java.lang.String relationName,
                                  GenericValue value)
                           throws GenericEntityException
Get related entity where relation is of type one, uses findByPrimaryKey NOTE 20080502: 7 references

Specified by:
getRelatedOne in interface DelegatorInterface
Throws:
java.lang.IllegalArgumentException - if the list found has more than one item
GenericEntityException

getRelatedOneCache

public GenericValue getRelatedOneCache(java.lang.String relationName,
                                       GenericValue value)
                                throws GenericEntityException
Get related entity where relation is of type one, uses findByPrimaryKey, checking first in the cache to see if the desired value is there NOTE 20080502: 1 references

Specified by:
getRelatedOneCache in interface DelegatorInterface
Throws:
java.lang.IllegalArgumentException - if the list found has more than one item
GenericEntityException

clearAllCaches

public void clearAllCaches()
This method is a shortcut to completely clear all entity engine caches. For performance reasons this should not be called very often.

Specified by:
clearAllCaches in interface DelegatorInterface

clearAllCaches

public void clearAllCaches(boolean distribute)
Specified by:
clearAllCaches in interface DelegatorInterface

clearCacheLine

public void clearCacheLine(java.lang.String entityName)
Remove all CACHED Generic Entity (List) from the cache

Specified by:
clearCacheLine in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file

clearCacheLine

public void clearCacheLine(java.lang.String entityName,
                           java.lang.Object... fields)
Remove a CACHED Generic Entity (List) from the cache, either a PK, ByAnd, or All

Specified by:
clearCacheLine in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values

clearCacheLine

public void clearCacheLine(java.lang.String entityName,
                           java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Remove a CACHED Generic Entity (List) from the cache, either a PK, ByAnd, or All

Specified by:
clearCacheLine in interface DelegatorInterface
Parameters:
entityName - The Name of the Entity as defined in the entity XML file
fields - The fields of the named entity to query by with their corresponging values

clearCacheLineFlexible

public void clearCacheLineFlexible(GenericEntity dummyPK)
Remove a CACHED Generic Entity from the cache by its primary key. Checks to see if the passed GenericPK is a complete primary key, if it is then the cache line will be removed from the primaryKeyCache; if it is NOT a complete primary key it will remove the cache line from the andCache. If the fields map is empty, then the allCache for the entity will be cleared.

Specified by:
clearCacheLineFlexible in interface DelegatorInterface
Parameters:
dummyPK - The dummy primary key to clear by.

clearCacheLineFlexible

public void clearCacheLineFlexible(GenericEntity dummyPK,
                                   boolean distribute)
Specified by:
clearCacheLineFlexible in interface DelegatorInterface

clearCacheValues

protected void clearCacheValues(UtilCache cache,
                                java.lang.String entityName,
                                EntityCondition condition)

clearCacheLineByCondition

public void clearCacheLineByCondition(java.lang.String entityName,
                                      EntityCondition condition)
Specified by:
clearCacheLineByCondition in interface DelegatorInterface

clearCacheLineByCondition

public void clearCacheLineByCondition(java.lang.String entityName,
                                      EntityCondition condition,
                                      boolean distribute)

clearCacheLine

public void clearCacheLine(GenericPK primaryKey)
Remove a CACHED Generic Entity from the cache by its primary key, does NOT check to see if the passed GenericPK is a complete primary key. Also tries to clear the corresponding all cache entry.

Specified by:
clearCacheLine in interface DelegatorInterface
Parameters:
primaryKey - The primary key to clear by.

clearCacheLine

public void clearCacheLine(GenericPK primaryKey,
                           boolean distribute)
Specified by:
clearCacheLine in interface DelegatorInterface

clearCacheLine

public void clearCacheLine(GenericValue value)
Remove a CACHED GenericValue from as many caches as it can. Automatically tries to remove entries from the all cache, the by primary key cache, and the by and cache. This is the ONLY method that tries to clear automatically from the by and cache.

Specified by:
clearCacheLine in interface DelegatorInterface
Parameters:
value - The GenericValue to clear by.

clearCacheLine

public void clearCacheLine(GenericValue value,
                           boolean distribute)
Specified by:
clearCacheLine in interface DelegatorInterface

clearAllCacheLinesByDummyPK

public void clearAllCacheLinesByDummyPK(java.util.Collection<GenericPK> dummyPKs)
Specified by:
clearAllCacheLinesByDummyPK in interface DelegatorInterface

clearAllCacheLinesByValue

public void clearAllCacheLinesByValue(java.util.Collection<GenericValue> values)
Specified by:
clearAllCacheLinesByValue in interface DelegatorInterface

getFromPrimaryKeyCache

public GenericValue getFromPrimaryKeyCache(GenericPK primaryKey)
Specified by:
getFromPrimaryKeyCache in interface DelegatorInterface

putInPrimaryKeyCache

public void putInPrimaryKeyCache(GenericPK primaryKey,
                                 GenericValue value)

putAllInPrimaryKeyCache

public void putAllInPrimaryKeyCache(java.util.List<GenericValue> values)

setDistributedCacheClear

public void setDistributedCacheClear(DistributedCacheClear distributedCacheClear)

readXmlDocument

public java.util.List<GenericValue> readXmlDocument(java.net.URL url)
                                             throws org.xml.sax.SAXException,
                                                    javax.xml.parsers.ParserConfigurationException,
                                                    java.io.IOException
Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException

makeValues

public java.util.List<GenericValue> makeValues(org.w3c.dom.Document document)

makePK

public GenericPK makePK(org.w3c.dom.Element element)

makeValue

public GenericValue makeValue(org.w3c.dom.Element element)

getEcaRuleRunner

protected GenericDelegator.EntityEcaRuleRunner<?> getEcaRuleRunner(java.lang.String entityName)

createEntityEcaRuleRunner

protected static <T> GenericDelegator.EntityEcaRuleRunner<T> createEntityEcaRuleRunner(EntityEcaHandler<T> entityEcaHandler,
                                                                                       java.lang.String entityName)

setEntityEcaHandler

public void setEntityEcaHandler(EntityEcaHandler entityEcaHandler)

getEntityEcaHandler

public EntityEcaHandler getEntityEcaHandler()

getNextSeqId

public java.lang.String getNextSeqId(java.lang.String seqName)
Get the next guaranteed unique seq id from the sequence with the given sequence name; if the named sequence doesn't exist, it will be created

Specified by:
getNextSeqId in interface DelegatorInterface
Parameters:
seqName - The name of the sequence to get the next seq id from
Returns:
String with the next sequenced id for the given sequence name

getNextSeqId

public java.lang.String getNextSeqId(java.lang.String seqName,
                                     long staggerMax)
Get the next guaranteed unique seq id from the sequence with the given sequence name; if the named sequence doesn't exist, it will be created

Specified by:
getNextSeqId in interface DelegatorInterface
Parameters:
seqName - The name of the sequence to get the next seq id from
staggerMax - The maximum amount to stagger the sequenced ID, if 1 the sequence will be incremented by 1, otherwise the current sequence ID will be incremented by a value between 1 and staggerMax
Returns:
Long with the next seq id for the given sequence name

getNextSeqIdLong

public java.lang.Long getNextSeqIdLong(java.lang.String seqName)
Get the next guaranteed unique seq id from the sequence with the given sequence name; if the named sequence doesn't exist, it will be created

Specified by:
getNextSeqIdLong in interface DelegatorInterface
Parameters:
seqName - The name of the sequence to get the next seq id from
Returns:
Long with the next sequenced id for the given sequence name

getNextSeqIdLong

public java.lang.Long getNextSeqIdLong(java.lang.String seqName,
                                       long staggerMax)
Get the next guaranteed unique seq id from the sequence with the given sequence name; if the named sequence doesn't exist, it will be created

Specified by:
getNextSeqIdLong in interface DelegatorInterface
Parameters:
seqName - The name of the sequence to get the next seq id from
staggerMax - The maximum amount to stagger the sequenced ID, if 1 the sequence will be incremented by 1, otherwise the current sequence ID will be incremented by a value between 1 and staggerMax
Returns:
Long with the next seq id for the given sequence name

setSequencer

public void setSequencer(SequenceUtil sequencer)
Allows you to pass a SequenceUtil class (possibly one that overrides the getNextSeqId method); if null is passed will effectively refresh the sequencer.

Specified by:
setSequencer in interface DelegatorInterface

refreshSequencer

public void refreshSequencer()
Refreshes the ID sequencer clearing all cached bank values.

Specified by:
refreshSequencer in interface DelegatorInterface

setNextSubSeqId

public void setNextSubSeqId(GenericValue value,
                            java.lang.String seqFieldName,
                            int numericPadding,
                            int incrementBy)
Look at existing values for a sub-entity with a sequenced secondary ID, and get the highest plus 1


encryptFields

public void encryptFields(java.util.List<? extends GenericEntity> entities)
                   throws GenericEntityException
Throws:
GenericEntityException

encryptFields

public void encryptFields(GenericEntity entity)
                   throws GenericEntityException
Throws:
GenericEntityException

encryptFieldValue

public java.lang.Object encryptFieldValue(java.lang.String entityName,
                                          java.lang.Object fieldValue)
                                   throws EntityCryptoException
Throws:
EntityCryptoException

decryptFields

public void decryptFields(java.util.List<? extends GenericEntity> entities)
                   throws GenericEntityException
Throws:
GenericEntityException

decryptFields

public void decryptFields(GenericEntity entity)
                   throws GenericEntityException
Throws:
GenericEntityException

setEntityCrypto

public void setEntityCrypto(EntityCrypto crypto)

absorbList

protected void absorbList(java.util.List<GenericValue> lst)

getCache

public Cache getCache()
Specified by:
getCache in interface DelegatorInterface

createEntityAuditLogAll

protected void createEntityAuditLogAll(GenericValue value,
                                       boolean isUpdate,
                                       boolean isRemove)
                                throws GenericEntityException
Throws:
GenericEntityException

createEntityAuditLogSingle

protected void createEntityAuditLogSingle(GenericValue value,
                                          ModelField mf,
                                          boolean isUpdate,
                                          boolean isRemove)
                                   throws GenericEntityException
Throws:
GenericEntityException

cloneDelegator

public GenericDelegator cloneDelegator(java.lang.String delegatorName)

cloneDelegator

public GenericDelegator cloneDelegator()

makeTestDelegator

public GenericDelegator makeTestDelegator(java.lang.String delegatorName)

rollback

public void rollback()