Class GenericDelegator
- java.lang.Object
-
- org.apache.ofbiz.entity.GenericDelegator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
GenericDelegator.EntityEcaRuleRunner<T>
static class
GenericDelegator.TestOperation
-
Nested classes/interfaces inherited from interface org.apache.ofbiz.entity.Delegator
Delegator.OperationType
-
-
Field Summary
Fields Modifier and Type Field Description 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 consistencyprotected java.util.concurrent.atomic.AtomicReference<SequenceUtil>
AtomicRefSequencer
protected Cache
cache
protected EntityCrypto
crypto
protected java.lang.String
delegatorBaseName
protected java.lang.String
delegatorFullName
protected DelegatorElement
delegatorInfo
protected java.lang.String
delegatorTenantId
protected java.util.concurrent.atomic.AtomicReference<java.util.concurrent.Future<DistributedCacheClear>>
distributedCacheClear
protected java.util.concurrent.atomic.AtomicReference<java.util.concurrent.Future<EntityEcaHandler<?>>>
entityEcaHandler
protected ModelGroupReader
modelGroupReader
protected ModelReader
modelReader
static java.lang.String
module
static boolean
saveEntitySyncRemoveInfo
protected boolean
warnNoEcaHandler
-
Constructor Summary
Constructors Modifier Constructor Description protected
GenericDelegator()
Only allow creation through the factory methodprotected
GenericDelegator(java.lang.String delegatorFullName)
Only allow creation through the factory method
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(java.lang.String entityName)
Remove all CACHED Generic Entity (List) from the cachevoid
clearCacheLine(java.lang.String entityName, java.lang.Object... fields)
Remove a CACHED Generic Entity (List) from the cache, either a PK, ByAnd, or Allvoid
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 Allvoid
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
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)
static void
clearSessionIdentifierStack()
static void
clearUserIdentifierStack()
Delegator
cloneDelegator()
Delegator
cloneDelegator(java.lang.String delegatorFullName)
GenericValue
create(java.lang.String entityName, java.lang.Object... fields)
Creates a Entity in the form of a GenericValue and write it to the databaseGenericValue
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 databaseGenericValue
create(GenericPK primaryKey)
Creates a Entity in the form of a GenericValue and write it to the datasourceGenericValue
create(GenericValue value)
Creates a Entity in the form of a GenericValue and write it to the datasourceprotected DistributedCacheClear
createDistributedCacheClear()
protected void
createEntityAuditLogAll(GenericValue value, boolean isUpdate, boolean isRemove)
protected void
createEntityAuditLogSingle(GenericValue value, ModelField mf, boolean isUpdate, boolean isRemove, java.sql.Timestamp nowTimestamp)
protected EntityEcaHandler<?>
createEntityEcaHandler()
protected static <T> GenericDelegator.EntityEcaRuleRunner<T>
createEntityEcaRuleRunner(EntityEcaHandler<T> entityEcaHandler, java.lang.String entityName)
protected java.util.concurrent.Callable<java.lang.Void>
createHelperCallable(java.lang.String groupName)
GenericValue
createOrStore(GenericValue value)
Creates or stores an EntityGenericValue
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 databasejava.lang.Object
decryptFieldValue(java.lang.String entityName, ModelField.EncryptMethod encryptMethod, java.lang.String encValue)
java.lang.Object
encryptFieldValue(java.lang.String entityName, ModelField.EncryptMethod encryptMethod, 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, boolean useCache)
Finds all Generic entitiesjava.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, boolean useCache)
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 fieldsGenericValue
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).long
findCountByCondition(java.lang.String entityName, EntityCondition whereEntityCondition, java.util.Set<java.lang.String> fieldsToSelect, EntityCondition havingEntityCondition, EntityFindOptions findOptions)
Gets the hit count of GenericValues for the given EntityCondition objects.long
findCountByCondition(java.lang.String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, EntityFindOptions findOptions)
Gets the hit count of GenericValues for the given EntityCondition objects.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.GenericValue
findOne(java.lang.String entityName, boolean useCache, java.lang.Object... fields)
Find a Generic Entity by its primary key.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 KeyCache
getCache()
java.lang.String
getCurrentSessionIdentifier()
java.lang.String
getCurrentUserIdentifier()
java.lang.String
getDelegatorBaseName()
java.lang.String
getDelegatorName()
java.lang.String
getDelegatorTenantId()
protected DistributedCacheClear
getDistributedCacheClear()
protected GenericDelegator.EntityEcaRuleRunner<?>
getEcaRuleRunner(java.lang.String entityName)
<T> EntityEcaHandler<T>
getEntityEcaHandler()
ModelFieldType
getEntityFieldType(ModelEntity entity, java.lang.String type)
Gets a field type instance by name from the helper that corresponds to the specified entityjava.util.Collection<java.lang.String>
getEntityFieldTypeNames(ModelEntity entity)
Gets field type names from the helper that corresponds to the specified entityjava.lang.String
getEntityGroupName(java.lang.String entityName)
Gets the helper name that corresponds to this delegator and the specified entityNameGenericHelper
getEntityHelper(java.lang.String entityName)
Gets the an instance of helper that corresponds to this delegator and the specified entityNameGenericHelper
getEntityHelper(ModelEntity entity)
Gets the an instance of helper that corresponds to this delegator and the specified entityprotected GenericHelperInfo
getEntityHelperInfo(java.lang.String entityName)
java.lang.String
getEntityHelperName(java.lang.String entityName)
Gets the helper name that corresponds to this delegator and the specified entityNamejava.lang.String
getEntityHelperName(ModelEntity entity)
Gets the helper name that corresponds to this delegator and the specified entityGenericValue
getFromPrimaryKeyCache(GenericPK primaryKey)
GenericHelperInfo
getGroupHelperInfo(java.lang.String entityGroupName)
java.lang.String
getGroupHelperName(java.lang.String groupName)
Gets the helper name that corresponds to this delegator and the specified entityNameModelEntity
getModelEntity(java.lang.String entityName)
Gets the instance of ModelEntity that corresponds to this delegator and the specified entityNamejava.util.Map<java.lang.String,ModelEntity>
getModelEntityMapByGroup(java.lang.String groupName)
Gets a Map of entity name and entity model pairs that are in the named groupModelFieldTypeReader
getModelFieldTypeReader(ModelEntity entity)
ModelGroupReader
getModelGroupReader()
Gets the instance of ModelGroupReader that corresponds to this delegatorModelReader
getModelReader()
Gets the instance of ModelReader that corresponds to this delegatorjava.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 createdjava.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 createdjava.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 createdjava.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 createdjava.lang.String
getOriginalDelegatorName()
Gets the name of the server configuration that corresponds to this delegatorjava.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, boolean useCache)
Get the named Related Entity for the GenericValue from the persistent storeGenericPK
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.GenericValue
getRelatedOne(java.lang.String relationName, GenericValue value, boolean useCache)
Get related entity where relation is of type one, uses findByPrimaryKeyprotected static java.util.List<java.lang.String>
getSessionIdentifierStack()
protected static java.util.List<java.lang.String>
getUserIdentifierStack()
void
initDistributedCacheClear()
void
initEntityEcaHandler()
GenericPK
makePK(java.lang.String entityName)
Creates a Primary Key in the form of a GenericPK without persisting itGenericPK
makePK(java.lang.String entityName, java.lang.Object... fields)
Creates a Primary Key in the form of a GenericPK without persisting itGenericPK
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 itGenericPK
makePK(org.w3c.dom.Element element)
GenericPK
makePKSingle(java.lang.String entityName, java.lang.Object singlePkValue)
Creates a Primary Key in the form of a GenericPK without persisting itDelegator
makeTestDelegator(java.lang.String delegatorName)
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 MapGenericValue
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 MapGenericValue
makeValue(java.lang.String entityName)
Creates a Entity in the form of a GenericValue without persisting itGenericValue
makeValue(java.lang.String entityName, java.lang.Object... fields)
Creates a Entity in the form of a GenericValue without persisting itGenericValue
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 itGenericValue
makeValue(org.w3c.dom.Element element)
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 itstatic 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 storevoid
refreshFromCache(GenericValue value)
Refresh the Entity for the GenericValue from the cachevoid
refreshSequencer()
Refreshes the ID sequencer clearing all cached bank values.int
removeAll(java.lang.String entityName)
int
removeAll(java.util.List<? extends GenericEntity> dummyPKs)
Remove the Entities from the List from the persistent store.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
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
removeByCondition(java.lang.String entityName, EntityCondition condition)
Removes/deletes Generic Entity records found by the conditionint
removeByPrimaryKey(GenericPK primaryKey)
Remove a Generic Entity corresponding to the primaryKeyint
removeRelated(java.lang.String relationName, GenericValue value)
Remove the named Related Entity for the GenericValue from the persistent storeint
removeValue(GenericValue value)
Remove a Generic Value from the databasevoid
rollback()
protected void
saveEntitySyncRemoveInfo(GenericEntity dummyPK)
protected void
setDelegatorNames(java.lang.String delegatorFullName)
void
setDistributedCacheClear(DistributedCacheClear distributedCacheClear)
void
setEntityCrypto(EntityCrypto crypto)
<T> void
setEntityEcaHandler(EntityEcaHandler<T> 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 1void
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 storeint
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, EntityStoreOptions storeOptions)
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.boolean
useDistributedCacheClear()
Get use of Distributed Cache Clear mechanism status
-
-
-
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
-
saveEntitySyncRemoveInfo
public static final boolean saveEntitySyncRemoveInfo
-
delegatorBaseName
protected java.lang.String delegatorBaseName
-
delegatorFullName
protected java.lang.String delegatorFullName
-
delegatorTenantId
protected java.lang.String delegatorTenantId
-
delegatorInfo
protected DelegatorElement delegatorInfo
-
cache
protected Cache cache
-
distributedCacheClear
protected final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.Future<DistributedCacheClear>> distributedCacheClear
-
warnNoEcaHandler
protected boolean warnNoEcaHandler
-
entityEcaHandler
protected final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.Future<EntityEcaHandler<?>>> entityEcaHandler
-
AtomicRefSequencer
protected final java.util.concurrent.atomic.AtomicReference<SequenceUtil> AtomicRefSequencer
-
crypto
protected EntityCrypto crypto
-
-
Constructor Detail
-
GenericDelegator
protected GenericDelegator()
Only allow creation through the factory method
-
GenericDelegator
protected GenericDelegator(java.lang.String delegatorFullName) throws GenericEntityException
Only allow creation through the factory method- Throws:
GenericEntityException
-
-
Method Detail
-
getUserIdentifierStack
protected static java.util.List<java.lang.String> getUserIdentifierStack()
-
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.String> getSessionIdentifierStack()
-
pushSessionIdentifier
public static void pushSessionIdentifier(java.lang.String sessionIdentifier)
-
popSessionIdentifier
public static java.lang.String popSessionIdentifier()
-
clearSessionIdentifierStack
public static void clearSessionIdentifierStack()
-
createHelperCallable
protected java.util.concurrent.Callable<java.lang.Void> createHelperCallable(java.lang.String groupName)
-
setDelegatorNames
protected void setDelegatorNames(java.lang.String delegatorFullName)
-
initEntityEcaHandler
public void initEntityEcaHandler()
- Specified by:
initEntityEcaHandler
in interfaceDelegator
-
createEntityEcaHandler
protected EntityEcaHandler<?> createEntityEcaHandler()
-
getDelegatorName
public java.lang.String getDelegatorName()
- Specified by:
getDelegatorName
in interfaceDelegator
-
getDelegatorBaseName
public java.lang.String getDelegatorBaseName()
- Specified by:
getDelegatorBaseName
in interfaceDelegator
-
getDelegatorTenantId
public java.lang.String getDelegatorTenantId()
- Specified by:
getDelegatorTenantId
in interfaceDelegator
-
getOriginalDelegatorName
public java.lang.String getOriginalDelegatorName()
Description copied from interface:Delegator
Gets the name of the server configuration that corresponds to this delegator- Specified by:
getOriginalDelegatorName
in interfaceDelegator
- Returns:
- server configuration name
-
getModelReader
public ModelReader getModelReader()
Description copied from interface:Delegator
Gets the instance of ModelReader that corresponds to this delegator- Specified by:
getModelReader
in interfaceDelegator
- Returns:
- ModelReader that corresponds to this delegator
-
getModelGroupReader
public ModelGroupReader getModelGroupReader()
Description copied from interface:Delegator
Gets the instance of ModelGroupReader that corresponds to this delegator- Specified by:
getModelGroupReader
in interfaceDelegator
- Returns:
- ModelGroupReader that corresponds to this delegator
-
getModelEntity
public ModelEntity getModelEntity(java.lang.String entityName)
Description copied from interface:Delegator
Gets the instance of ModelEntity that corresponds to this delegator and the specified entityName- Specified by:
getModelEntity
in interfaceDelegator
- 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)
Description copied from interface:Delegator
Gets the helper name that corresponds to this delegator and the specified entityName- Specified by:
getEntityGroupName
in interfaceDelegator
- 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
Description copied from interface:Delegator
Gets a Map of entity name and entity model pairs that are in the named group- Specified by:
getModelEntityMapByGroup
in interfaceDelegator
- 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)
Description copied from interface:Delegator
Gets the helper name that corresponds to this delegator and the specified entityName- Specified by:
getGroupHelperName
in interfaceDelegator
- 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
-
getGroupHelperInfo
public GenericHelperInfo getGroupHelperInfo(java.lang.String entityGroupName)
- Specified by:
getGroupHelperInfo
in interfaceDelegator
-
getEntityHelperInfo
protected GenericHelperInfo getEntityHelperInfo(java.lang.String entityName)
-
getEntityHelperName
public java.lang.String getEntityHelperName(java.lang.String entityName)
Description copied from interface:Delegator
Gets the helper name that corresponds to this delegator and the specified entityName- Specified by:
getEntityHelperName
in interfaceDelegator
- 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)
Description copied from interface:Delegator
Gets the helper name that corresponds to this delegator and the specified entity- Specified by:
getEntityHelperName
in interfaceDelegator
- 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
Description copied from interface:Delegator
Gets the an instance of helper that corresponds to this delegator and the specified entityName- Specified by:
getEntityHelper
in interfaceDelegator
- 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
Description copied from interface:Delegator
Gets the an instance of helper that corresponds to this delegator and the specified entity- Specified by:
getEntityHelper
in interfaceDelegator
- 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
Description copied from interface:Delegator
Gets a field type instance by name from the helper that corresponds to the specified entity- Specified by:
getEntityFieldType
in interfaceDelegator
- Parameters:
entity
- The entitytype
- The name of the type- Returns:
- ModelFieldType instance for the named type from the helper that corresponds to the specified entity
- Throws:
GenericEntityException
-
getModelFieldTypeReader
public ModelFieldTypeReader getModelFieldTypeReader(ModelEntity entity)
- Specified by:
getModelFieldTypeReader
in interfaceDelegator
-
getEntityFieldTypeNames
public java.util.Collection<java.lang.String> getEntityFieldTypeNames(ModelEntity entity) throws GenericEntityException
Description copied from interface:Delegator
Gets field type names from the helper that corresponds to the specified entity- Specified by:
getEntityFieldTypeNames
in interfaceDelegator
- 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)
Description copied from interface:Delegator
Creates a Entity in the form of a GenericValue without persisting it
-
makeValue
public GenericValue makeValue(java.lang.String entityName, java.lang.Object... fields)
Description copied from interface:Delegator
Creates a Entity in the form of a GenericValue without persisting it
-
makeValue
public GenericValue makeValue(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Description copied from interface:Delegator
Creates a Entity in the form of a GenericValue without persisting it
-
makeValueSingle
public GenericValue makeValueSingle(java.lang.String entityName, java.lang.Object singlePkValue)
Description copied from interface:Delegator
Creates a Entity in the form of a GenericValue without persisting it- Specified by:
makeValueSingle
in interfaceDelegator
-
makeValidValue
public GenericValue makeValidValue(java.lang.String entityName, java.lang.Object... fields)
Description copied from interface:Delegator
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 interfaceDelegator
-
makeValidValue
public GenericValue makeValidValue(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Description copied from interface:Delegator
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 interfaceDelegator
-
makePK
public GenericPK makePK(java.lang.String entityName)
Description copied from interface:Delegator
Creates a Primary Key in the form of a GenericPK without persisting it
-
makePK
public GenericPK makePK(java.lang.String entityName, java.lang.Object... fields)
Description copied from interface:Delegator
Creates a Primary Key in the form of a GenericPK without persisting it
-
makePK
public GenericPK makePK(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Description copied from interface:Delegator
Creates a Primary Key in the form of a GenericPK without persisting it
-
makePKSingle
public GenericPK makePKSingle(java.lang.String entityName, java.lang.Object singlePkValue)
Description copied from interface:Delegator
Creates a Primary Key in the form of a GenericPK without persisting it- Specified by:
makePKSingle
in interfaceDelegator
-
create
public GenericValue create(GenericPK primaryKey) throws GenericEntityException
Description copied from interface:Delegator
Creates a Entity in the form of a GenericValue and write it to the datasource- Specified by:
create
in interfaceDelegator
- 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(java.lang.String entityName, java.lang.Object... fields) throws GenericEntityException
Description copied from interface:Delegator
Creates a Entity in the form of a GenericValue and write it to the database- Specified by:
create
in interfaceDelegator
- 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
Description copied from interface:Delegator
Creates a Entity in the form of a GenericValue and write it to the database- Specified by:
create
in interfaceDelegator
- Returns:
- GenericValue instance containing the new instance
- Throws:
GenericEntityException
-
createSingle
public GenericValue createSingle(java.lang.String entityName, java.lang.Object singlePkValue) throws GenericEntityException
Description copied from interface:Delegator
Creates a Entity in the form of a GenericValue and write it to the database- Specified by:
createSingle
in interfaceDelegator
- Returns:
- GenericValue instance containing the new instance
- Throws:
GenericEntityException
-
createSetNextSeqId
public GenericValue createSetNextSeqId(GenericValue value) throws GenericEntityException
Description copied from interface:Delegator
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.- Specified by:
createSetNextSeqId
in interfaceDelegator
- 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) throws GenericEntityException
Description copied from interface:Delegator
Creates a Entity in the form of a GenericValue and write it to the datasource- Specified by:
create
in interfaceDelegator
- Parameters:
value
- The GenericValue to create a value in the datasource from- Returns:
- GenericValue instance containing the new instance
- Throws:
GenericEntityException
-
createOrStore
public GenericValue createOrStore(GenericValue value) throws GenericEntityException
Description copied from interface:Delegator
Creates or stores an Entity- Specified by:
createOrStore
in interfaceDelegator
- 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
Description copied from interface:Delegator
Remove a Generic Entity corresponding to the primaryKey- Specified by:
removeByPrimaryKey
in interfaceDelegator
- Parameters:
primaryKey
- The primary key of the entity to remove.- Returns:
- int representing number of rows effected by this operation
- Throws:
GenericEntityException
-
removeValue
public int removeValue(GenericValue value) throws GenericEntityException
Description copied from interface:Delegator
Remove a Generic Value from the database- Specified by:
removeValue
in interfaceDelegator
- Parameters:
value
- The GenericValue object of the entity to remove.- 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
Description copied from interface:Delegator
Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND)- Specified by:
removeByAnd
in interfaceDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML filefields
- The fields of the named entity to query by with their corresponding 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
Description copied from interface:Delegator
Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND)- Specified by:
removeByAnd
in interfaceDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML filefields
- The fields of the named entity to query by with their corresponding values- Returns:
- int representing number of rows effected by this operation
- Throws:
GenericEntityException
-
removeByCondition
public int removeByCondition(java.lang.String entityName, EntityCondition condition) throws GenericEntityException
Description copied from interface:Delegator
Removes/deletes Generic Entity records found by the condition- Specified by:
removeByCondition
in interfaceDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML filecondition
- The condition used to restrict the removing- Returns:
- int representing number of rows effected by this operation
- Throws:
GenericEntityException
-
removeRelated
public int removeRelated(java.lang.String relationName, GenericValue value) throws GenericEntityException
Description copied from interface:Delegator
Remove the named Related Entity for the GenericValue from the persistent store- Specified by:
removeRelated
in interfaceDelegator
- 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 filevalue
- GenericValue instance containing the entity- Returns:
- int representing number of rows effected by this operation
- Throws:
GenericEntityException
-
refresh
public void refresh(GenericValue value) throws GenericEntityException
Description copied from interface:Delegator
Refresh the Entity for the GenericValue from the persistent store- Specified by:
refresh
in interfaceDelegator
- Parameters:
value
- GenericValue instance containing the entity to refresh- Throws:
GenericEntityException
-
refreshFromCache
public void refreshFromCache(GenericValue value) throws GenericEntityException
Description copied from interface:Delegator
Refresh the Entity for the GenericValue from the cache- Specified by:
refreshFromCache
in interfaceDelegator
- 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
Description copied from interface:Delegator
Store a group of values.- Specified by:
storeByCondition
in interfaceDelegator
- Parameters:
entityName
- The name of the Entity as defined in the entity XML filefieldsToSet
- The fields of the named entity to set in the databasecondition
- The condition that restricts the list of stored values- Returns:
- int representing number of rows effected by this operation
- Throws:
GenericEntityException
-
store
public int store(GenericValue value) throws GenericEntityException
Description copied from interface:Delegator
Store the Entity from the GenericValue to the persistent store- Specified by:
store
in interfaceDelegator
- Parameters:
value
- GenericValue instance containing the entity- Returns:
- int representing number of rows effected by this operation
- Throws:
GenericEntityException
-
storeAll
public int storeAll(java.util.List<GenericValue> values) throws GenericEntityException
Description copied from interface:Delegator
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 interfaceDelegator
- 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, EntityStoreOptions storeOptions) throws GenericEntityException
Description copied from interface:Delegator
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 interfaceDelegator
- Parameters:
values
- List of GenericValue instances containing the entities to storestoreOptions
- An instance of EntityStoreOptions that specifies advanced store options or null for default values. See the EntityStoreOptions JavaDoc for more details.- 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 interfaceDelegator
- Throws:
GenericEntityException
-
removeAll
public int removeAll(java.util.List<? extends GenericEntity> dummyPKs) throws GenericEntityException
Description copied from interface:Delegator
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 interfaceDelegator
- 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
-
findOne
public GenericValue findOne(java.lang.String entityName, boolean useCache, java.lang.Object... fields) throws GenericEntityException
Description copied from interface:Delegator
Find a Generic Entity by its primary key.- Specified by:
findOne
in interfaceDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML fileuseCache
- Retrieve the Generic Entity from the cache whentrue
fields
- The fields of the named entity to query by with their corresponding values- Returns:
- The Generic Entity corresponding to the primary key
- 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
Description copied from interface:Delegator
Find a Generic Entity by its Primary Key- Specified by:
findOne
in interfaceDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML filefields
- The fields of the named entity to query by with their corresponding values- Returns:
- The GenericValue corresponding to the primaryKey
- Throws:
GenericEntityException
-
findByPrimaryKeyPartial
public GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, java.util.Set<java.lang.String> keys) throws GenericEntityException
Description copied from interface:Delegator
Find a Generic Entity by its Primary Key and only returns the values requested by the passed keys (names).- Specified by:
findByPrimaryKeyPartial
in interfaceDelegator
- 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
-
findAll
public java.util.List<GenericValue> findAll(java.lang.String entityName, boolean useCache) throws GenericEntityException
Finds all Generic entities- Specified by:
findAll
in interfaceDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML fileuseCache
- Whether to cache the results- Returns:
- List containing all Generic entities
- Throws:
GenericEntityException
- See Also:
Delegator.findAll(java.lang.String, boolean)
-
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, boolean useCache) throws GenericEntityException
Description copied from interface:Delegator
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- Specified by:
findByAnd
in interfaceDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML filefields
- The fields of the named entity to query by with their corresponding valuesorderBy
- The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descendinguseCache
- Whether to cache the results- Returns:
- List of GenericValue instances that match the query
- 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
Description copied from interface:Delegator
Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.- Specified by:
find
in interfaceDelegator
- Parameters:
entityName
- The name of the Entity as defined in the entity XML filewhereEntityCondition
- 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 retreivedorderBy
- The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descendingfindOptions
- 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
Description copied from interface:Delegator
Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.- Specified by:
findList
in interfaceDelegator
- Parameters:
entityName
- The name of the Entity as defined in the entity XML fileentityCondition
- 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 retrievedorderBy
- The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descendingfindOptions
- 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
Description copied from interface:Delegator
Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.- Specified by:
findListIteratorByCondition
in interfaceDelegator
- Parameters:
dynamicViewEntity
- The DynamicViewEntity to use for the entity model for this query; generally created on the fly for limited usewhereEntityCondition
- 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 retreivedorderBy
- The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descendingfindOptions
- 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
-
findCountByCondition
public long findCountByCondition(java.lang.String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, EntityFindOptions findOptions) throws GenericEntityException
Description copied from interface:Delegator
Gets the hit count of GenericValues for the given EntityCondition objects.- Specified by:
findCountByCondition
in interfaceDelegator
- Returns:
- long value with hit count
- Throws:
GenericEntityException
-
findCountByCondition
public long findCountByCondition(java.lang.String entityName, EntityCondition whereEntityCondition, java.util.Set<java.lang.String> fieldsToSelect, EntityCondition havingEntityCondition, EntityFindOptions findOptions) throws GenericEntityException
Description copied from interface:Delegator
Gets the hit count of GenericValues for the given EntityCondition objects.- Specified by:
findCountByCondition
in interfaceDelegator
- Returns:
- long value with hit count
- 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
Description copied from interface:Delegator
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.- Specified by:
getMultiRelation
in interfaceDelegator
- Parameters:
value
- GenericValue instance containing the entityrelationNameOne
- String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file, for first relationrelationNameTwo
- String containing the relation name for second relationorderBy
- The fields of the named entity to order the query by; may be null; optionally add a " ASC" for ascending or " DESC" for descending- 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, boolean useCache) throws GenericEntityException
Description copied from interface:Delegator
Get the named Related Entity for the GenericValue from the persistent store- Specified by:
getRelated
in interfaceDelegator
- 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 filebyAndFields
- the fields that must equal in order to keep; may be nullorderBy
- The fields of the named entity to order the query by; may be null; optionally add a " ASC" for ascending or " DESC" for descendingvalue
- GenericValue instance containing the entityuseCache
- Whether to cache the results- 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
Description copied from interface:Delegator
Get a dummy primary key for the named Related Entity for the GenericValue.- Specified by:
getRelatedDummyPK
in interfaceDelegator
- 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 filebyAndFields
- the fields that must equal in order to keep; may be nullvalue
- GenericValue instance containing the entity- Returns:
- GenericPK containing a possibly incomplete PrimaryKey object representing the related entity or entities
- Throws:
GenericEntityException
-
getRelatedOne
public GenericValue getRelatedOne(java.lang.String relationName, GenericValue value, boolean useCache) throws GenericEntityException
Description copied from interface:Delegator
Get related entity where relation is of type one, uses findByPrimaryKey- Specified by:
getRelatedOne
in interfaceDelegator
- 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 filevalue
- GenericValue instance containing the entityuseCache
- Whether to cache the results- Returns:
- GenericValue that is the related entity
- Throws:
GenericEntityException
-
clearAllCaches
public void clearAllCaches()
Description copied from interface:Delegator
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 interfaceDelegator
-
clearAllCaches
public void clearAllCaches(boolean distribute)
- Specified by:
clearAllCaches
in interfaceDelegator
-
clearCacheLine
public void clearCacheLine(java.lang.String entityName)
Description copied from interface:Delegator
Remove all CACHED Generic Entity (List) from the cache- Specified by:
clearCacheLine
in interfaceDelegator
- 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)
Description copied from interface:Delegator
Remove a CACHED Generic Entity (List) from the cache, either a PK, ByAnd, or All- Specified by:
clearCacheLine
in interfaceDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML filefields
- The fields of the named entity to query by with their corresponding values
-
clearCacheLine
public void clearCacheLine(java.lang.String entityName, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Description copied from interface:Delegator
Remove a CACHED Generic Entity (List) from the cache, either a PK, ByAnd, or All- Specified by:
clearCacheLine
in interfaceDelegator
- Parameters:
entityName
- The Name of the Entity as defined in the entity XML filefields
- The fields of the named entity to query by with their corresponding values
-
clearCacheLineFlexible
public void clearCacheLineFlexible(GenericEntity dummyPK)
Description copied from interface:Delegator
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 interfaceDelegator
- Parameters:
dummyPK
- The dummy primary key to clear by.
-
clearCacheLineFlexible
public void clearCacheLineFlexible(GenericEntity dummyPK, boolean distribute)
- Specified by:
clearCacheLineFlexible
in interfaceDelegator
-
clearCacheLineByCondition
public void clearCacheLineByCondition(java.lang.String entityName, EntityCondition condition)
- Specified by:
clearCacheLineByCondition
in interfaceDelegator
-
clearCacheLineByCondition
public void clearCacheLineByCondition(java.lang.String entityName, EntityCondition condition, boolean distribute)
- Specified by:
clearCacheLineByCondition
in interfaceDelegator
-
clearCacheLine
public void clearCacheLine(GenericPK primaryKey)
Description copied from interface:Delegator
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 interfaceDelegator
- Parameters:
primaryKey
- The primary key to clear by.
-
clearCacheLine
public void clearCacheLine(GenericPK primaryKey, boolean distribute)
- Specified by:
clearCacheLine
in interfaceDelegator
-
clearCacheLine
public void clearCacheLine(GenericValue value)
Description copied from interface:Delegator
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 interfaceDelegator
- Parameters:
value
- The GenericValue to clear by.
-
clearCacheLine
public void clearCacheLine(GenericValue value, boolean distribute)
- Specified by:
clearCacheLine
in interfaceDelegator
-
clearAllCacheLinesByDummyPK
public void clearAllCacheLinesByDummyPK(java.util.Collection<GenericPK> dummyPKs)
- Specified by:
clearAllCacheLinesByDummyPK
in interfaceDelegator
-
clearAllCacheLinesByValue
public void clearAllCacheLinesByValue(java.util.Collection<GenericValue> values)
- Specified by:
clearAllCacheLinesByValue
in interfaceDelegator
-
getFromPrimaryKeyCache
public GenericValue getFromPrimaryKeyCache(GenericPK primaryKey)
- Specified by:
getFromPrimaryKeyCache
in interfaceDelegator
-
putInPrimaryKeyCache
public void putInPrimaryKeyCache(GenericPK primaryKey, GenericValue value)
- Specified by:
putInPrimaryKeyCache
in interfaceDelegator
-
putAllInPrimaryKeyCache
public void putAllInPrimaryKeyCache(java.util.List<GenericValue> values)
- Specified by:
putAllInPrimaryKeyCache
in interfaceDelegator
-
setDistributedCacheClear
public void setDistributedCacheClear(DistributedCacheClear distributedCacheClear)
- Specified by:
setDistributedCacheClear
in interfaceDelegator
-
readXmlDocument
public java.util.List<GenericValue> readXmlDocument(java.net.URL url) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
- Specified by:
readXmlDocument
in interfaceDelegator
- Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
-
makeValues
public java.util.List<GenericValue> makeValues(org.w3c.dom.Document document)
- Specified by:
makeValues
in interfaceDelegator
-
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 <T> void setEntityEcaHandler(EntityEcaHandler<T> entityEcaHandler)
- Specified by:
setEntityEcaHandler
in interfaceDelegator
-
getEntityEcaHandler
public <T> EntityEcaHandler<T> getEntityEcaHandler()
- Specified by:
getEntityEcaHandler
in interfaceDelegator
-
getNextSeqId
public java.lang.String getNextSeqId(java.lang.String seqName)
Description copied from interface:Delegator
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 interfaceDelegator
- 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)
Description copied from interface:Delegator
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 interfaceDelegator
- Parameters:
seqName
- The name of the sequence to get the next seq id fromstaggerMax
- 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)
Description copied from interface:Delegator
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 interfaceDelegator
- 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)
Description copied from interface:Delegator
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 interfaceDelegator
- Parameters:
seqName
- The name of the sequence to get the next seq id fromstaggerMax
- 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)
Description copied from interface:Delegator
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 interfaceDelegator
-
refreshSequencer
public void refreshSequencer()
Description copied from interface:Delegator
Refreshes the ID sequencer clearing all cached bank values.- Specified by:
refreshSequencer
in interfaceDelegator
-
setNextSubSeqId
public void setNextSubSeqId(GenericValue value, java.lang.String seqFieldName, int numericPadding, int incrementBy)
Description copied from interface:Delegator
Look at existing values for a sub-entity with a sequenced secondary ID, and get the highest plus 1- Specified by:
setNextSubSeqId
in interfaceDelegator
-
encryptFieldValue
public java.lang.Object encryptFieldValue(java.lang.String entityName, ModelField.EncryptMethod encryptMethod, java.lang.Object fieldValue) throws EntityCryptoException
- Specified by:
encryptFieldValue
in interfaceDelegator
- Throws:
EntityCryptoException
-
decryptFieldValue
public java.lang.Object decryptFieldValue(java.lang.String entityName, ModelField.EncryptMethod encryptMethod, java.lang.String encValue) throws EntityCryptoException
- Specified by:
decryptFieldValue
in interfaceDelegator
- Throws:
EntityCryptoException
-
setEntityCrypto
public void setEntityCrypto(EntityCrypto crypto)
- Specified by:
setEntityCrypto
in interfaceDelegator
-
absorbList
protected void absorbList(java.util.List<GenericValue> lst)
-
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, java.sql.Timestamp nowTimestamp) throws GenericEntityException
- Throws:
GenericEntityException
-
cloneDelegator
public Delegator cloneDelegator(java.lang.String delegatorFullName)
- Specified by:
cloneDelegator
in interfaceDelegator
-
cloneDelegator
public Delegator cloneDelegator()
- Specified by:
cloneDelegator
in interfaceDelegator
-
makeTestDelegator
public Delegator makeTestDelegator(java.lang.String delegatorName)
- Specified by:
makeTestDelegator
in interfaceDelegator
-
initDistributedCacheClear
public void initDistributedCacheClear()
- Specified by:
initDistributedCacheClear
in interfaceDelegator
-
createDistributedCacheClear
protected DistributedCacheClear createDistributedCacheClear()
-
getDistributedCacheClear
protected DistributedCacheClear getDistributedCacheClear()
-
useDistributedCacheClear
public boolean useDistributedCacheClear()
Description copied from interface:Delegator
Get use of Distributed Cache Clear mechanism status- Specified by:
useDistributedCacheClear
in interfaceDelegator
- Returns:
- boolean true if this delegator uses a Distributed Cache Clear mechanism
-
getCurrentSessionIdentifier
public java.lang.String getCurrentSessionIdentifier()
- Specified by:
getCurrentSessionIdentifier
in interfaceDelegator
-
getCurrentUserIdentifier
public java.lang.String getCurrentUserIdentifier()
- Specified by:
getCurrentUserIdentifier
in interfaceDelegator
-
-