Class LockedDatabaseGenericDelegator
- All Implemented Interfaces:
DelegatorInterface
-
Field Summary
Fields inherited from class org.ofbiz.core.entity.GenericDelegator
allCache, andCache, andCacheFieldSets, delegatorInfo, delegatorName, distributedCacheClear, modelGroupReader, modelReader, module, primaryKeyCache, sequencer, sqlEscapeHelper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearAllCacheLinesByDummyPK(Collection<? extends GenericEntity> dummyPKs) voidclearAllCacheLinesByValue(Collection<? extends GenericValue> values) voidThis method is a shortcut to completely clear all entity engine caches.voidclearAllCaches(boolean distribute) voidclearCacheLine(String entityName, Map<String, ?> fields) Remove a CACHED Generic Entity (List) from the cache, either a PK, ByAnd, or AllvoidclearCacheLine(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.voidclearCacheLine(GenericPK primaryKey, boolean distribute) voidclearCacheLine(GenericValue value) Remove a CACHED GenericValue from as many caches as it can.voidclearCacheLine(GenericValue value, boolean distribute) voidclearCacheLineFlexible(GenericEntity dummyPK) Remove a CACHED Generic Entity from the cache by its primary key.voidclearCacheLineFlexible(GenericEntity dummyPK, boolean distribute) intReturns the row count of the specified entity.intcountByAnd(String entityName, String fieldName, List<? extends EntityCondition> expressions, EntityFindOptions findOptions) Returns the count of the results that match all of the specified expressions (i.e.intcountByCondition(String entityName, String fieldName, EntityCondition condition, EntityFindOptions findOptions) Returns the count of the results that match any of the specified expressions (ie: combined using OR).intcountByOr(String entityName, String fieldName, List<? extends EntityCondition> expressions, EntityFindOptions findOptions) Returns the count of the results that match any of the specified expressions (i.e.Creates a Entity in the form of a GenericValue and write it to the database.Creates a Entity in the form of a GenericValue and write it to the datasource.Creates a Entity in the form of a GenericValue and write it to the datasource.create(GenericValue value) Creates a Entity in the form of a GenericValue and write it to the datasource.create(GenericValue value, boolean doCacheClear) Creates a Entity in the form of a GenericValue and write it to the datasource.Finds all Generic entities of the given type.Finds all Generic entities of the given type, optionally sorted.findAllByPrimaryKeys(Collection<? extends GenericPK> primaryKeys) Find a number of Generic Value objects by their Primary Keys, all at once.findAllByPrimaryKeysCache(Collection<? extends 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.findAllCache(String entityName) Finds all Generic entities of the given type, looking first in the cache.findAllCache(String entityName, List<String> orderBy) Finds all Generic entities, looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields.findByAnd(String entityName, List<? extends EntityCondition> expressions) Finds Generic Entity records by all of the specified expressions (ie: combined using AND).Finds Generic Entity records by all of the specified expressions (i.e.Finds Generic Entity records by all of the specified fields (ie: combined using AND).Finds Generic Entity records by all of the specified fields (i.e.Finds any entities matching the given criteria.findByAndCache(String entityName, Map<String, ?> fields) Finds Generic Entity records by all of the specified fields (i.e.Finds Generic Entity records by all of the specified fields (i.e.findByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) Finds any GenericValues matching the given conditions.findByLike(String entityName, Map<String, ?> fields) findByOr(String entityName, List<? extends EntityCondition> expressions) Finds Generic Entity records by all of the specified expressions (i.e.Finds Generic Entity records by all of the specified expressions (i.e.Finds Generic Entity records by any of the specified fields (i.e.Finds Generic Entity records by all of the specified fields (i.e.findByPrimaryKey(String entityName, Map<String, ?> fields) Find a Generic Entity by its Primary Key.findByPrimaryKey(GenericPK primaryKey) Find a Generic Entity by its Primary Key.findByPrimaryKeyCache(String entityName, Map<String, ?> fields) Find a CACHED Generic Entity by its Primary Key.findByPrimaryKeyCache(GenericPK primaryKey) Find a cached Generic Entity by its Primary Key.findByPrimaryKeyPartial(GenericPK primaryKey, Set<String> keys) Find a Generic Entity by its Primary Key and only returns the values requested by the passed keys (names).findListIteratorByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) Finds GenericValues by the given conditions.findListIteratorByCondition(String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, Collection<String> fieldsToSelect, List<String> orderBy, EntityFindOptions findOptions) Finds GenericValues by the given conditions.protected EntityConfigUtil.DelegatorInfoGets the name of the server configuration that corresponds to this delegator.protected Map<?,?> getEcaEntityEventMap(String entityName) getEntityFieldType(ModelEntity entity, String type) Gets a field type instance by name from the helper that corresponds to the specified entity.getEntityFieldTypeNames(ModelEntity entity) Gets field type names from the helper that corresponds to the specified entity.getEntityGroupName(String entityName) Gets the helper name that corresponds to this delegator and the specified entityName.getEntityHelper(String entityName) Gets the helper that corresponds to this delegator and the specified entityName.getEntityHelper(ModelEntity entity) Gets the helper that corresponds to this delegator and the specified entity.getEntityHelperName(String entityName) Gets the helper name that corresponds to this delegator and the specified entityName.getEntityHelperName(ModelEntity entity) Gets the helper name that corresponds to this delegator and the specified entity.getFieldNameSetsCopy(String entityName) Gets a Set of Sets of fieldNames used in the by and cache for the given entityName.getFromAllCache(String entityName) getFromAndCache(String entityName, Map<String, ?> fields) getFromAndCache(ModelEntity entity, Map<String, ?> fields) getFromPrimaryKeyCache(GenericPK primaryKey) getGroupHelperName(String groupName) Gets the helper name that corresponds to this delegator and the specified entityName.getModelEntitiesByGroup(String groupName) Gets a list of entity models that are in a group corresponding to the specified group name.getModelEntity(String entityName) Gets the instance of ModelEntity that corresponds to this delegator and the specified entityName.getModelEntityMapByGroup(String groupName) Gets a Map of entity name & entity model pairs that are in the named group.Gets the instance of ModelGroupReader that corresponds to this delegator.Gets the instance of ModelReader that corresponds to this delegator.getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo) Get the named Related Entity for the GenericValue from the persistent store across another Relation.getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo, List<String> orderBy) Get the named Related Entity for the GenericValue from the persistent store across another Relation.getNextSeqId(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.getNextSeqId(String seqName, boolean clusterMode) 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.getRelated(String relationName, Map<String, ?> byAndFields, List<String> orderBy, GenericValue value) Get the named Related Entity for the GenericValue from the persistent store.getRelated(String relationName, GenericValue value) Get the named Related Entity for the GenericValue from the persistent storegetRelatedByAnd(String relationName, Map<String, ?> byAndFields, GenericValue value) Get the named Related Entity for the GenericValue from the persistent store.getRelatedCache(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.getRelatedDummyPK(String relationName, Map<String, ?> byAndFields, GenericValue value) Get a dummy primary key for the named Related Entity for the GenericValue.getRelatedOne(String relationName, GenericValue value) Get related entity where relation is of type one, uses findByPrimaryKey.getRelatedOneCache(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.getRelatedOrderBy(String relationName, List<String> orderBy, GenericValue value) Get the named Related Entity for the GenericValue from the persistent store.Creates a Primary Key in the form of a GenericPK without persisting it.Creates a Entity in the form of a GenericValue without persisting it.makeValues(Document document) Parses the given XML document for entities.voidputAllInPrimaryKeyCache(List<? extends GenericValue> values) voidputInAllCache(String entityName, List<? extends GenericValue> values) voidputInAllCache(ModelEntity entity, List<? extends GenericValue> values) voidputInAndCache(String entityName, Map<String, ?> fields, List<? extends GenericValue> values) voidputInAndCache(ModelEntity entity, Map<String, ?> fields, List<? extends GenericValue> values) voidputInPrimaryKeyCache(GenericPK primaryKey, GenericValue value) readXmlDocument(URL url) Parses the given XML file for entities.voidrefresh(GenericValue value) Refresh the Entity for the GenericValue from the persistent store.voidrefresh(GenericValue value, boolean doCacheClear) Refresh the Entity for the GenericValue from the persistent store.voidRefreshes the ID sequencer clearing all cached bank values.intremoveAll(List<? extends GenericEntity> dummyPKs) Remove the Entities from the List from the persistent store.intremoveAll(List<? extends GenericEntity> dummyPKs, boolean doCacheClear) Remove the Entities from the List from the persistent store.intremoveByAnd(String entityName, Map<String, ?> fields) Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND).intremoveByAnd(String entityName, Map<String, ?> fields, boolean doCacheClear) Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND).intremoveByCondition(String entityName, EntityCondition entityCondition) Removes/deletes Generic Entity records found by matching the EntityCondition.intremoveByCondition(String entityName, EntityCondition entityCondition, boolean doCacheClear) Removes/deletes Generic Entity records found by matching the EntityCondition.intremoveByPrimaryKey(GenericPK primaryKey) Remove a Generic Entity corresponding to the primaryKey.intremoveByPrimaryKey(GenericPK primaryKey, boolean doCacheClear) Remove a Generic Entity corresponding to the primaryKey.intremoveRelated(String relationName, GenericValue value) Remove the named Related Entity for the GenericValue from the persistent store.intremoveRelated(String relationName, GenericValue value, boolean doCacheClear) Remove the named Related Entity for the GenericValue from the persistent store.intremoveValue(GenericValue value) Remove a Generic Value from the database.intremoveValue(GenericValue value, boolean doCacheClear) Remove a Generic Value from the database.voidsetSequencer(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.intstore(GenericValue value) Store the Entity from the GenericValue to the persistent store.intstore(GenericValue value, boolean doCacheClear) Store the Entity from the GenericValue to the persistent store.intstoreAll(List<? extends GenericValue> values) Store the Entities from the List GenericValue instances to the persistent store.intstoreAll(List<? extends GenericValue> values, boolean doCacheClear) Store the Entities from the List GenericValue instances to the persistent store.transform(String entityName, EntityCondition entityCondition, List<String> orderBy, String lockField, Transformation transformation) Applies the given transformation to any entities matching the given condition.Methods inherited from class org.ofbiz.core.entity.GenericDelegator
getGenericDelegator, getSqlEscapeHelper, initialiseAndCheckDatabase, isLocked, lock, removeGenericDelegator, unlock
-
Constructor Details
-
LockedDatabaseGenericDelegator
public LockedDatabaseGenericDelegator() -
LockedDatabaseGenericDelegator
-
-
Method Details
-
clearAllCacheLinesByDummyPK
- Specified by:
clearAllCacheLinesByDummyPKin interfaceDelegatorInterface- Overrides:
clearAllCacheLinesByDummyPKin classGenericDelegator
-
clearAllCacheLinesByValue
- Specified by:
clearAllCacheLinesByValuein interfaceDelegatorInterface- Overrides:
clearAllCacheLinesByValuein classGenericDelegator
-
clearAllCaches
public void clearAllCaches()Description copied from class:GenericDelegatorThis method is a shortcut to completely clear all entity engine caches. For performance reasons this should not be called very often.- Specified by:
clearAllCachesin interfaceDelegatorInterface- Overrides:
clearAllCachesin classGenericDelegator
-
clearAllCaches
public void clearAllCaches(boolean distribute) - Specified by:
clearAllCachesin interfaceDelegatorInterface- Overrides:
clearAllCachesin classGenericDelegator
-
clearCacheLine
Description copied from class:GenericDelegatorRemove a CACHED Generic Entity (List) from the cache, either a PK, ByAnd, or All- Specified by:
clearCacheLinein interfaceDelegatorInterface- Overrides:
clearCacheLinein classGenericDelegator- 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 corresponging values
-
clearCacheLine
Description copied from class:GenericDelegatorRemove 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:
clearCacheLinein interfaceDelegatorInterface- Overrides:
clearCacheLinein classGenericDelegator- Parameters:
primaryKey- The primary key to clear by.
-
clearCacheLine
- Specified by:
clearCacheLinein interfaceDelegatorInterface- Overrides:
clearCacheLinein classGenericDelegator
-
clearCacheLine
Description copied from class:GenericDelegatorRemove 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:
clearCacheLinein interfaceDelegatorInterface- Overrides:
clearCacheLinein classGenericDelegator- Parameters:
value- The primary key to clear by.
-
clearCacheLine
- Specified by:
clearCacheLinein interfaceDelegatorInterface- Overrides:
clearCacheLinein classGenericDelegator
-
clearCacheLineFlexible
Description copied from class:GenericDelegatorRemove a CACHED Generic Entity from the cache by its primary key. Checks whether 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:
clearCacheLineFlexiblein interfaceDelegatorInterface- Overrides:
clearCacheLineFlexiblein classGenericDelegator- Parameters:
dummyPK- The dummy primary key to clear by.
-
clearCacheLineFlexible
- Specified by:
clearCacheLineFlexiblein interfaceDelegatorInterface- Overrides:
clearCacheLineFlexiblein classGenericDelegator
-
create
Description copied from class:GenericDelegatorCreates a Entity in the form of a GenericValue and write it to the database.- Specified by:
createin interfaceDelegatorInterface- Overrides:
createin classGenericDelegator- Parameters:
entityName- the type of entity to create (if null, this method does nothing)fields- the field values to use (if null, this method does nothing)- Returns:
- the created instance
- Throws:
GenericEntityException
-
create
Description copied from class:GenericDelegatorCreates a Entity in the form of a GenericValue and write it to the datasource.- Specified by:
createin interfaceDelegatorInterface- Overrides:
createin classGenericDelegator- 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 Description copied from class:GenericDelegatorCreates a Entity in the form of a GenericValue and write it to the datasource.- Specified by:
createin interfaceDelegatorInterface- Overrides:
createin classGenericDelegator- Parameters:
primaryKey- the PK from which to create a value in the datasource (required)doCacheClear- whether to clear related cache entries for this primaryKey to be created- Returns:
- GenericValue instance containing the new instance
- Throws:
GenericEntityException
-
create
Description copied from class:GenericDelegatorCreates a Entity in the form of a GenericValue and write it to the datasource.- Specified by:
createin interfaceDelegatorInterface- Overrides:
createin classGenericDelegator- Parameters:
value- The GenericValue to create a value in the datasource from- Returns:
- GenericValue instance containing the new instance
- Throws:
GenericEntityException
-
create
Description copied from class:GenericDelegatorCreates a Entity in the form of a GenericValue and write it to the datasource.- Specified by:
createin interfaceDelegatorInterface- Overrides:
createin classGenericDelegator- Parameters:
value- The GenericValue from which to create a value in the datasource (required)doCacheClear- whether to automatically clear cache entries related to this operation- Returns:
- GenericValue instance containing the new instance
- Throws:
GenericEntityException
-
findAll
Description copied from class:GenericDelegatorFinds all Generic entities of the given type.- Specified by:
findAllin interfaceDelegatorInterface- Overrides:
findAllin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity XML file- Returns:
- all entities of the given type
- Throws:
GenericEntityException
-
findAll
public List<GenericValue> findAll(String entityName, List<String> orderBy) throws GenericEntityException Description copied from class:GenericDelegatorFinds all Generic entities of the given type, optionally sorted.- Specified by:
findAllin interfaceDelegatorInterface- Overrides:
findAllin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity XML fileorderBy- the entity fields by which to order the query; optionally add " ASC" for ascending or " DESC" for descending to each field name- Returns:
- List containing all Generic entities
- Throws:
GenericEntityException
-
findAllByPrimaryKeys
public List<GenericValue> findAllByPrimaryKeys(Collection<? extends GenericPK> primaryKeys) throws GenericEntityException Description copied from class:GenericDelegatorFind a number of Generic Value objects by their Primary Keys, all at once.- Specified by:
findAllByPrimaryKeysin interfaceDelegatorInterface- Overrides:
findAllByPrimaryKeysin classGenericDelegator- 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 List<GenericValue> findAllByPrimaryKeysCache(Collection<? extends GenericPK> primaryKeys) throws GenericEntityException Description copied from class:GenericDelegatorFind 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.- Specified by:
findAllByPrimaryKeysCachein interfaceDelegatorInterface- Overrides:
findAllByPrimaryKeysCachein classGenericDelegator- Parameters:
primaryKeys- A Collection of primary keys to find by.- Returns:
- List of GenericValue objects corresponding to the passed primaryKey objects
- Throws:
GenericEntityException
-
findAllCache
Description copied from class:GenericDelegatorFinds all Generic entities of the given type, looking first in the cache.- Specified by:
findAllCachein interfaceDelegatorInterface- Overrides:
findAllCachein classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity XML file- Returns:
- List containing all Generic entities
- Throws:
GenericEntityException
-
findAllCache
public List<GenericValue> findAllCache(String entityName, List<String> orderBy) throws GenericEntityException Description copied from class:GenericDelegatorFinds all Generic entities, looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields.- Specified by:
findAllCachein interfaceDelegatorInterface- Overrides:
findAllCachein classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity XML fileorderBy- The fields of the named entity by which to order the query; optionally add " ASC" for ascending or " DESC" for descending- Returns:
- all Generic entities
- Throws:
GenericEntityException
-
findByAnd
public List<GenericValue> findByAnd(String entityName, List<? extends EntityCondition> expressions) throws GenericEntityException Description copied from class:GenericDelegatorFinds Generic Entity records by all of the specified expressions (ie: combined using AND).- Specified by:
findByAndin interfaceDelegatorInterface- Overrides:
findByAndin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity XML fileexpressions- 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 List<GenericValue> findByAnd(String entityName, List<? extends EntityCondition> expressions, List<String> orderBy) throws GenericEntityException Description copied from class:GenericDelegatorFinds Generic Entity records by all of the specified expressions (i.e. combined using AND).- Specified by:
findByAndin interfaceDelegatorInterface- Overrides:
findByAndin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity XML fileexpressions- The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare toorderBy- The fields of the named entity to order the query by; optionally add " ASC" for ascending or " DESC" for descending- Returns:
- List of GenericValue instances that match the query
- Throws:
GenericEntityException
-
findByAnd
public List<GenericValue> findByAnd(String entityName, Map<String, ?> fields) throws GenericEntityExceptionDescription copied from class:GenericDelegatorFinds Generic Entity records by all of the specified fields (ie: combined using AND).- Specified by:
findByAndin interfaceDelegatorInterface- Overrides:
findByAndin classGenericDelegator- 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 corresponging values- Returns:
- List of GenericValue instances that match the query
- Throws:
GenericEntityException
-
findByAnd
public List<GenericValue> findByAnd(String entityName, Map<String, ?> fields, List<String> orderBy) throws GenericEntityExceptionDescription copied from class:GenericDelegatorFinds Generic Entity records by all of the specified fields (i.e. combined using AND).- Specified by:
findByAndin interfaceDelegatorInterface- Overrides:
findByAndin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity XML filefields- the names and values of the fields by which to query (can be null)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 List<GenericValue> findByAnd(ModelEntity modelEntity, Map<String, ?> fields, List<String> orderBy) throws GenericEntityExceptionDescription copied from class:GenericDelegatorFinds any entities matching the given criteria.- Specified by:
findByAndin interfaceDelegatorInterface- Overrides:
findByAndin classGenericDelegator- Parameters:
modelEntity- the type of entity to find (required)fields- the names and values of the fields by which to query (can be null)orderBy- the names of fields by which to sort the results (can be null)- Returns:
- any matching entities
- Throws:
GenericEntityException
-
findByAndCache
public List<GenericValue> findByAndCache(String entityName, Map<String, ?> fields) throws GenericEntityExceptionDescription copied from class:GenericDelegatorFinds Generic Entity records by all of the specified fields (i.e. combined using AND), looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields.- Specified by:
findByAndCachein interfaceDelegatorInterface- Overrides:
findByAndCachein classGenericDelegator- 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 corresponging values- Returns:
- List of GenericValue instances that match the query
- Throws:
GenericEntityException
-
findByAndCache
public List<GenericValue> findByAndCache(String entityName, Map<String, ?> fields, List<String> orderBy) throws GenericEntityExceptionDescription copied from class:GenericDelegatorFinds Generic Entity records by all of the specified fields (i.e. combined using AND), looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields.- Specified by:
findByAndCachein interfaceDelegatorInterface- Overrides:
findByAndCachein classGenericDelegator- 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 corresponging valuesorderBy- The fields of the named entity to order the query by; optionally add " ASC" for ascending or " DESC" for descending- Returns:
- List of GenericValue instances that match the query
- Throws:
GenericEntityException
-
findByCondition
public List<GenericValue> findByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) throws GenericEntityException Description copied from class:GenericDelegatorFinds any GenericValues matching the given conditions.- Specified by:
findByConditionin interfaceDelegatorInterface- Overrides:
findByConditionin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity model XML fileentityCondition- The EntityCondition object that specifies how to constrain this queryfieldsToSelect- 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 by which to order the query; optionally add " ASC" for ascending or " DESC" for descending- Returns:
- any matching values
- Throws:
GenericEntityException
-
countByAnd
public int countByAnd(String entityName, String fieldName, List<? extends EntityCondition> expressions, EntityFindOptions findOptions) throws GenericEntityException Description copied from class:GenericDelegatorReturns the count of the results that match all of the specified expressions (i.e. combined using AND).- Specified by:
countByAndin interfaceDelegatorInterface- Overrides:
countByAndin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity model XML filefieldName- The field of the named entity to count, if null this is equivalent to count(*)expressions- The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare tofindOptions- An instance of EntityFindOptions that specifies advanced query options. The only option that is used is distinct, in which case a select (distinct fieldname) is issued.If you issue a distinct without a fieldName, it will be ignored because
select count (distinct *)makes no sense- Returns:
- the number of rows that match the query
- Throws:
GenericEntityException
-
countByOr
public int countByOr(String entityName, String fieldName, List<? extends EntityCondition> expressions, EntityFindOptions findOptions) throws GenericEntityException Description copied from class:GenericDelegatorReturns the count of the results that match any of the specified expressions (i.e. combined using OR).- Specified by:
countByOrin interfaceDelegatorInterface- Overrides:
countByOrin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity model XML filefieldName- The field of the named entity to count, if null this is equivalent to count(*)expressions- The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare tofindOptions- An instance of EntityFindOptions that specifies advanced query options. The only option that is used is distinct, in which case aselect (distinct fieldname)is issued.If you issue a distinct without a fieldName, it will be ignored because
select count (distinct *)makes no sense- Returns:
- the number of rows that match the query
- Throws:
GenericEntityException
-
countByCondition
public int countByCondition(String entityName, String fieldName, EntityCondition condition, EntityFindOptions findOptions) throws GenericEntityException Description copied from class:GenericDelegatorReturns the count of the results that match any of the specified expressions (ie: combined using OR).- Specified by:
countByConditionin interfaceDelegatorInterface- Overrides:
countByConditionin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity model XML filefieldName- The field of the named entity to count, if null this is equivalent to count(*)condition- The EntityCondition object that specifies how to constrain this query The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare tofindOptions- An instance of EntityFindOptions that specifies advanced query options. The only option that is used is distinct, in which case a select (distinct fieldname) is issued.If you issue a distinct without a fieldName, it will be ignored as
select count (distinct *)makes no sense- Returns:
- the number of rows that match the query
- Throws:
GenericEntityException
-
countAll
Description copied from class:GenericDelegatorReturns the row count of the specified entity.- Specified by:
countAllin interfaceDelegatorInterface- Overrides:
countAllin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity model XML file- Returns:
- the number of rows in the table
- Throws:
GenericEntityException
-
findByLike
public List<GenericValue> findByLike(String entityName, Map<String, ?> fields) throws GenericEntityException- Specified by:
findByLikein interfaceDelegatorInterface- Overrides:
findByLikein classGenericDelegator- Throws:
GenericEntityException
-
findByLike
public List<GenericValue> findByLike(String entityName, Map<String, ?> fields, List<String> orderBy) throws GenericEntityException- Specified by:
findByLikein interfaceDelegatorInterface- Overrides:
findByLikein classGenericDelegator- Throws:
GenericEntityException
-
findByOr
public List<GenericValue> findByOr(String entityName, List<? extends EntityCondition> expressions) throws GenericEntityException Description copied from class:GenericDelegatorFinds Generic Entity records by all of the specified expressions (i.e. combined using OR).- Specified by:
findByOrin interfaceDelegatorInterface- Overrides:
findByOrin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity XML fileexpressions- 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 List<GenericValue> findByOr(String entityName, List<? extends EntityCondition> expressions, List<String> orderBy) throws GenericEntityException Description copied from class:GenericDelegatorFinds Generic Entity records by all of the specified expressions (i.e. combined using OR).- Specified by:
findByOrin interfaceDelegatorInterface- Overrides:
findByOrin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity XML fileexpressions- The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare toorderBy- The fields of the named entity to order the query by; optionally add " ASC" for ascending or " DESC" for descending- Returns:
- List of GenericValue instances that match the query
- Throws:
GenericEntityException
-
findByOr
public List<GenericValue> findByOr(String entityName, Map<String, ?> fields) throws GenericEntityExceptionDescription copied from class:GenericDelegatorFinds Generic Entity records by any of the specified fields (i.e. combined using OR).- Specified by:
findByOrin interfaceDelegatorInterface- Overrides:
findByOrin classGenericDelegator- 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 corresponging values- Returns:
- List of GenericValue instances that match the query
- Throws:
GenericEntityException
-
findByOr
public List<GenericValue> findByOr(String entityName, Map<String, ?> fields, List<String> orderBy) throws GenericEntityExceptionDescription copied from class:GenericDelegatorFinds Generic Entity records by all of the specified fields (i.e. combined using OR).- Specified by:
findByOrin interfaceDelegatorInterface- Overrides:
findByOrin classGenericDelegator- 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 corresponging valuesorderBy- 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
-
findByPrimaryKey
public GenericValue findByPrimaryKey(String entityName, Map<String, ?> fields) throws GenericEntityExceptionDescription copied from class:GenericDelegatorFind a Generic Entity by its Primary Key.- Specified by:
findByPrimaryKeyin interfaceDelegatorInterface- Overrides:
findByPrimaryKeyin classGenericDelegator- 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 corresponging values- Returns:
- The GenericValue corresponding to the primaryKey
- Throws:
GenericEntityException
-
findByPrimaryKey
Description copied from class:GenericDelegatorFind a Generic Entity by its Primary Key.- Specified by:
findByPrimaryKeyin interfaceDelegatorInterface- Overrides:
findByPrimaryKeyin classGenericDelegator- Parameters:
primaryKey- The primary key to find by.- Returns:
- The GenericValue corresponding to the primaryKey
- Throws:
GenericEntityException
-
findByPrimaryKeyCache
public GenericValue findByPrimaryKeyCache(String entityName, Map<String, ?> fields) throws GenericEntityExceptionDescription copied from class:GenericDelegatorFind a CACHED Generic Entity by its Primary Key.- Specified by:
findByPrimaryKeyCachein interfaceDelegatorInterface- Overrides:
findByPrimaryKeyCachein classGenericDelegator- 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 corresponging values- Returns:
- The GenericValue corresponding to the primaryKey
- Throws:
GenericEntityException
-
findByPrimaryKeyCache
Description copied from class:GenericDelegatorFind a cached Generic Entity by its Primary Key.- Specified by:
findByPrimaryKeyCachein interfaceDelegatorInterface- Overrides:
findByPrimaryKeyCachein classGenericDelegator- Parameters:
primaryKey- The primary key to find by.- Returns:
- The GenericValue corresponding to the primaryKey
- Throws:
GenericEntityException
-
findByPrimaryKeyPartial
public GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, Set<String> keys) throws GenericEntityException Description copied from class:GenericDelegatorFind a Generic Entity by its Primary Key and only returns the values requested by the passed keys (names).- Specified by:
findByPrimaryKeyPartialin interfaceDelegatorInterface- Overrides:
findByPrimaryKeyPartialin classGenericDelegator- 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
-
findListIteratorByCondition
public EntityListIterator findListIteratorByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) throws GenericEntityException Description copied from class:GenericDelegatorFinds GenericValues by the given conditions.- Specified by:
findListIteratorByConditionin interfaceDelegatorInterface- Overrides:
findListIteratorByConditionin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity model 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 retreivedorderBy- The fields of the named entity to order the query by; optionally add " 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 BECAUSE IT WILL MAINTAIN A DATABASE CONNECTION.
- Throws:
GenericEntityException
-
findListIteratorByCondition
public EntityListIterator findListIteratorByCondition(String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, Collection<String> fieldsToSelect, List<String> orderBy, EntityFindOptions findOptions) throws GenericEntityException Description copied from class:GenericDelegatorFinds GenericValues by the given conditions.- Specified by:
findListIteratorByConditionin interfaceDelegatorInterface- Overrides:
findListIteratorByConditionin classGenericDelegator- Parameters:
entityName- The ModelEntity 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 " 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 BECAUSE IT WILL MAINTAIN A DATABASE CONNECTION.
- Throws:
GenericEntityException- See Also:
-
getAllCache
- Specified by:
getAllCachein interfaceDelegatorInterface- Overrides:
getAllCachein classGenericDelegator
-
getAndCache
- Specified by:
getAndCachein interfaceDelegatorInterface- Overrides:
getAndCachein classGenericDelegator
-
getDelegatorInfo
- Overrides:
getDelegatorInfoin classGenericDelegator
-
getDelegatorName
Description copied from class:GenericDelegatorGets the name of the server configuration that corresponds to this delegator.- Specified by:
getDelegatorNamein interfaceDelegatorInterface- Overrides:
getDelegatorNamein classGenericDelegator- Returns:
- server configuration name
-
getEcaEntityEventMap
-
getEntityFieldType
public ModelFieldType getEntityFieldType(ModelEntity entity, String type) throws GenericEntityException Description copied from class:GenericDelegatorGets a field type instance by name from the helper that corresponds to the specified entity.- Specified by:
getEntityFieldTypein interfaceDelegatorInterface- Overrides:
getEntityFieldTypein classGenericDelegator- 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
-
getEntityFieldTypeNames
Description copied from class:GenericDelegatorGets field type names from the helper that corresponds to the specified entity.- Specified by:
getEntityFieldTypeNamesin interfaceDelegatorInterface- Overrides:
getEntityFieldTypeNamesin classGenericDelegator- Parameters:
entity- The entity- Returns:
- Collection of field type names from the helper that corresponds to the specified entity
- Throws:
GenericEntityException
-
getEntityGroupName
Description copied from class:GenericDelegatorGets the helper name that corresponds to this delegator and the specified entityName.- Specified by:
getEntityGroupNamein interfaceDelegatorInterface- Overrides:
getEntityGroupNamein classGenericDelegator- 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
-
getEntityHelper
Description copied from class:GenericDelegatorGets the helper that corresponds to this delegator and the specified entity.- Specified by:
getEntityHelperin interfaceDelegatorInterface- Overrides:
getEntityHelperin classGenericDelegator- Parameters:
entity- The entity for which to get the helper (required)- Returns:
- GenericHelper that corresponds to this delegator and the specified entity
- Throws:
GenericEntityException
-
getEntityHelper
Description copied from class:GenericDelegatorGets the helper that corresponds to this delegator and the specified entityName.- Specified by:
getEntityHelperin interfaceDelegatorInterface- Overrides:
getEntityHelperin classGenericDelegator- 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
-
getEntityHelperName
Description copied from class:GenericDelegatorGets the helper name that corresponds to this delegator and the specified entity.- Specified by:
getEntityHelperNamein interfaceDelegatorInterface- Overrides:
getEntityHelperNamein classGenericDelegator- Parameters:
entity- the entity for which to get the helper (can be null)- Returns:
- String with the helper name that corresponds to this delegator and the specified entity
-
getEntityHelperName
Description copied from class:GenericDelegatorGets the helper name that corresponds to this delegator and the specified entityName.- Specified by:
getEntityHelperNamein interfaceDelegatorInterface- Overrides:
getEntityHelperNamein classGenericDelegator- 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
-
getFieldNameSetsCopy
Description copied from class:GenericDelegatorGets a Set of Sets of fieldNames used in the by and cache for the given entityName.- Specified by:
getFieldNameSetsCopyin interfaceDelegatorInterface- Overrides:
getFieldNameSetsCopyin classGenericDelegator- Parameters:
entityName- the entity for which to get the field names (can be null)- Returns:
- null if the field name is null or simply unknown
-
getFromAllCache
- Specified by:
getFromAllCachein interfaceDelegatorInterface- Overrides:
getFromAllCachein classGenericDelegator
-
getFromAndCache
- Specified by:
getFromAndCachein interfaceDelegatorInterface- Overrides:
getFromAndCachein classGenericDelegator
-
getFromAndCache
- Specified by:
getFromAndCachein interfaceDelegatorInterface- Overrides:
getFromAndCachein classGenericDelegator
-
getFromPrimaryKeyCache
- Specified by:
getFromPrimaryKeyCachein interfaceDelegatorInterface- Overrides:
getFromPrimaryKeyCachein classGenericDelegator
-
getGroupHelperName
Description copied from class:GenericDelegatorGets the helper name that corresponds to this delegator and the specified entityName.- Specified by:
getGroupHelperNamein interfaceDelegatorInterface- Overrides:
getGroupHelperNamein classGenericDelegator- 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
-
getModelEntitiesByGroup
Description copied from class:GenericDelegatorGets a list of entity models that are in a group corresponding to the specified group name.- Specified by:
getModelEntitiesByGroupin interfaceDelegatorInterface- Overrides:
getModelEntitiesByGroupin classGenericDelegator- Parameters:
groupName- The name of the group- Returns:
- List of ModelEntity instances
-
getModelEntity
Description copied from class:GenericDelegatorGets the instance of ModelEntity that corresponds to this delegator and the specified entityName.- Specified by:
getModelEntityin interfaceDelegatorInterface- Overrides:
getModelEntityin classGenericDelegator- Parameters:
entityName- The name of the entity to get- Returns:
- ModelEntity that corresponds to this delegator and the specified entityName
-
getModelEntityMapByGroup
Description copied from class:GenericDelegatorGets a Map of entity name & entity model pairs that are in the named group.- Specified by:
getModelEntityMapByGroupin interfaceDelegatorInterface- Overrides:
getModelEntityMapByGroupin classGenericDelegator- Parameters:
groupName- The name of the group- Returns:
- Map of entityName String keys and ModelEntity instance values
-
getModelGroupReader
Description copied from class:GenericDelegatorGets the instance of ModelGroupReader that corresponds to this delegator.- Specified by:
getModelGroupReaderin interfaceDelegatorInterface- Overrides:
getModelGroupReaderin classGenericDelegator- Returns:
- ModelGroupReader that corresponds to this delegator
-
getModelReader
Description copied from class:GenericDelegatorGets the instance of ModelReader that corresponds to this delegator.- Specified by:
getModelReaderin interfaceDelegatorInterface- Overrides:
getModelReaderin classGenericDelegator- Returns:
- ModelReader that corresponds to this delegator
-
getMultiRelation
public List<GenericValue> getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo) throws GenericEntityException Description copied from class:GenericDelegatorGet 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:
getMultiRelationin interfaceDelegatorInterface- Overrides:
getMultiRelationin classGenericDelegator- 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 relation- Returns:
- List of GenericValue instances as specified in the relation definition
- Throws:
GenericEntityException
-
getMultiRelation
public List<GenericValue> getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo, List<String> orderBy) throws GenericEntityException Description copied from class:GenericDelegatorGet 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:
getMultiRelationin interfaceDelegatorInterface- Overrides:
getMultiRelationin classGenericDelegator- 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
-
getNextSeqId
Description copied from interface:DelegatorInterfaceGet 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.From v1.3.0 this is equivalent of calling
DelegatorInterface.getNextSeqId(String, boolean)with true as second parameter.- Parameters:
seqName- The name of the sequence to get the next seq id from- Returns:
- Long with the next seq id for the given sequence name
-
getNextSeqId
Description copied from interface:DelegatorInterfaceGet 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.If the instance should be running in cluster mode then it will try a SELECT FOR UPDATE approach to retrieving the next bank of sequence ids, to avoid potential collisions with other nodes.
If not in cluster mode, this is not required, and the existing JVM synchronization locking is enough.
It will be in clusterMode if true is passed as a parameter, or if
EntityConfigUtil.DelegatorInfo.useDistributedCacheClearis enabled- Specified by:
getNextSeqIdin interfaceDelegatorInterface- Overrides:
getNextSeqIdin classGenericDelegator- Parameters:
seqName- The name of the sequence to get the next seq id fromclusterMode- Is this a node in a clustered instance or not- Returns:
- Long with the next seq id for the given sequence name
-
getPrimaryKeyCache
- Specified by:
getPrimaryKeyCachein interfaceDelegatorInterface- Overrides:
getPrimaryKeyCachein classGenericDelegator
-
getRelated
public List<GenericValue> getRelated(String relationName, Map<String, ?> byAndFields, List<String> orderBy, GenericValue value) throws GenericEntityExceptionDescription copied from class:GenericDelegatorGet the named Related Entity for the GenericValue from the persistent store.- Specified by:
getRelatedin interfaceDelegatorInterface- Overrides:
getRelatedin classGenericDelegator- 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 entity- Returns:
- List of GenericValue instances as specified in the relation definition
- Throws:
GenericEntityException
-
getRelated
public List<GenericValue> getRelated(String relationName, GenericValue value) throws GenericEntityException Description copied from class:GenericDelegatorGet the named Related Entity for the GenericValue from the persistent store- Specified by:
getRelatedin interfaceDelegatorInterface- Overrides:
getRelatedin classGenericDelegator- 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:
- List of GenericValue instances as specified in the relation definition
- Throws:
GenericEntityException
-
getRelatedByAnd
public List<GenericValue> getRelatedByAnd(String relationName, Map<String, ?> byAndFields, GenericValue value) throws GenericEntityExceptionDescription copied from class:GenericDelegatorGet the named Related Entity for the GenericValue from the persistent store.- Specified by:
getRelatedByAndin interfaceDelegatorInterface- Overrides:
getRelatedByAndin classGenericDelegator- 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:
- List of GenericValue instances as specified in the relation definition
- Throws:
GenericEntityException
-
getRelatedCache
public List<GenericValue> getRelatedCache(String relationName, GenericValue value) throws GenericEntityException Description copied from class:GenericDelegatorGet the named Related Entity for the GenericValue from the persistent store, checking first in the cache to see if the desired value is there.- Specified by:
getRelatedCachein interfaceDelegatorInterface- Overrides:
getRelatedCachein classGenericDelegator- 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:
- List of GenericValue instances as specified in the relation definition
- Throws:
GenericEntityException
-
getRelatedDummyPK
public GenericPK getRelatedDummyPK(String relationName, Map<String, ?> byAndFields, GenericValue value) throws GenericEntityExceptionDescription copied from class:GenericDelegatorGet a dummy primary key for the named Related Entity for the GenericValue.- Specified by:
getRelatedDummyPKin interfaceDelegatorInterface- Overrides:
getRelatedDummyPKin classGenericDelegator- 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(String relationName, GenericValue value) throws GenericEntityException Description copied from class:GenericDelegatorGet related entity where relation is of type one, uses findByPrimaryKey.- Specified by:
getRelatedOnein interfaceDelegatorInterface- Overrides:
getRelatedOnein classGenericDelegator- Parameters:
relationName- the name of the relation to get (required)value- the value whose relation to get (required)- Throws:
GenericEntityException
-
getRelatedOneCache
public GenericValue getRelatedOneCache(String relationName, GenericValue value) throws GenericEntityException Description copied from class:GenericDelegatorGet related entity where relation is of type one, uses findByPrimaryKey, checking first in the cache to see if the desired value is there.- Specified by:
getRelatedOneCachein interfaceDelegatorInterface- Overrides:
getRelatedOneCachein classGenericDelegator- Parameters:
relationName- the name of the relation to get (required)value- the value whose relation to get (required)- Throws:
GenericEntityException
-
getRelatedOrderBy
public List<GenericValue> getRelatedOrderBy(String relationName, List<String> orderBy, GenericValue value) throws GenericEntityException Description copied from class:GenericDelegatorGet the named Related Entity for the GenericValue from the persistent store.- Specified by:
getRelatedOrderByin interfaceDelegatorInterface- Overrides:
getRelatedOrderByin classGenericDelegator- 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 fileorderBy- 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 entity- Returns:
- List of GenericValue instances as specified in the relation definition
- Throws:
GenericEntityException
-
makePK
- Overrides:
makePKin classGenericDelegator
-
makePK
Description copied from class:GenericDelegatorCreates a Primary Key in the form of a GenericPK without persisting it.- Specified by:
makePKin interfaceDelegatorInterface- Overrides:
makePKin classGenericDelegator- Parameters:
entityName- the type of entity for which to create a PK (must exist in the model)fields- the primary key fields and their values (can be null)- Returns:
- the created PK
-
makeValue
- Overrides:
makeValuein classGenericDelegator
-
makeValue
Description copied from class:GenericDelegatorCreates a Entity in the form of a GenericValue without persisting it.- Specified by:
makeValuein interfaceDelegatorInterface- Overrides:
makeValuein classGenericDelegator- Parameters:
entityName- the type of entity to create (must exist in the model)fields- the entity fields and their values (can be null)- Returns:
- the created value
-
makeValues
Description copied from class:GenericDelegatorParses the given XML document for entities. Does not insert them into the database.- Overrides:
makeValuesin classGenericDelegator- Parameters:
document- the document to parse (can be null)- Returns:
- null if a null document was given, otherwise the parsed entities
-
putAllInPrimaryKeyCache
- Specified by:
putAllInPrimaryKeyCachein interfaceDelegatorInterface- Overrides:
putAllInPrimaryKeyCachein classGenericDelegator
-
putInAllCache
- Specified by:
putInAllCachein interfaceDelegatorInterface- Overrides:
putInAllCachein classGenericDelegator
-
putInAllCache
- Specified by:
putInAllCachein interfaceDelegatorInterface- Overrides:
putInAllCachein classGenericDelegator
-
putInAndCache
public void putInAndCache(ModelEntity entity, Map<String, ?> fields, List<? extends GenericValue> values) - Specified by:
putInAndCachein interfaceDelegatorInterface- Overrides:
putInAndCachein classGenericDelegator
-
putInAndCache
public void putInAndCache(String entityName, Map<String, ?> fields, List<? extends GenericValue> values) - Specified by:
putInAndCachein interfaceDelegatorInterface- Overrides:
putInAndCachein classGenericDelegator
-
putInPrimaryKeyCache
- Specified by:
putInPrimaryKeyCachein interfaceDelegatorInterface- Overrides:
putInPrimaryKeyCachein classGenericDelegator
-
readXmlDocument
public List<GenericValue> readXmlDocument(URL url) throws SAXException, ParserConfigurationException, IOException Description copied from class:GenericDelegatorParses the given XML file for entities. Does not insert them into the database.- Overrides:
readXmlDocumentin classGenericDelegator- Parameters:
url- the URL of the XML file (can be null)- Returns:
- null if a null URL was given, otherwise the parsed entities
- Throws:
SAXExceptionParserConfigurationExceptionIOException
-
refresh
Description copied from class:GenericDelegatorRefresh the Entity for the GenericValue from the persistent store.- Specified by:
refreshin interfaceDelegatorInterface- Overrides:
refreshin classGenericDelegator- Parameters:
value- GenericValue instance containing the entity to refresh- Throws:
GenericEntityException
-
refresh
Description copied from class:GenericDelegatorRefresh the Entity for the GenericValue from the persistent store.- Specified by:
refreshin interfaceDelegatorInterface- Overrides:
refreshin classGenericDelegator- Parameters:
value- GenericValue instance containing the entity to refreshdoCacheClear- whether to automatically clear cache entries related to this operation- Throws:
GenericEntityException
-
refreshSequencer
public void refreshSequencer()Description copied from class:GenericDelegatorRefreshes the ID sequencer clearing all cached bank values.- Specified by:
refreshSequencerin interfaceDelegatorInterface- Overrides:
refreshSequencerin classGenericDelegator
-
removeAll
Description copied from class:GenericDelegatorRemove 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:
removeAllin interfaceDelegatorInterface- Overrides:
removeAllin classGenericDelegator- Parameters:
dummyPKs- Collection of GenericEntity instances containing the entities or by and fields to remove- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
removeAll
public int removeAll(List<? extends GenericEntity> dummyPKs, boolean doCacheClear) throws GenericEntityException Description copied from class:GenericDelegatorRemove 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:
removeAllin interfaceDelegatorInterface- Overrides:
removeAllin classGenericDelegator- Parameters:
dummyPKs- Collection of GenericEntity instances containing the entities or by and fields to removedoCacheClear- whether to automatically clear cache entries related to this operation- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
removeByAnd
Description copied from class:GenericDelegatorRemoves/deletes Generic Entity records found by all of the specified fields (ie: combined using AND).- Specified by:
removeByAndin interfaceDelegatorInterface- Overrides:
removeByAndin classGenericDelegator- 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 corresponging values- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
removeByAnd
public int removeByAnd(String entityName, Map<String, ?> fields, boolean doCacheClear) throws GenericEntityExceptionDescription copied from class:GenericDelegatorRemoves/deletes Generic Entity records found by all of the specified fields (ie: combined using AND).- Specified by:
removeByAndin interfaceDelegatorInterface- Overrides:
removeByAndin classGenericDelegator- 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 corresponging valuesdoCacheClear- boolean that specifies whether to clear cache entries for this value to be removed- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
removeByCondition
public int removeByCondition(String entityName, EntityCondition entityCondition) throws GenericEntityException Description copied from class:GenericDelegatorRemoves/deletes Generic Entity records found by matching the EntityCondition.- Specified by:
removeByConditionin interfaceDelegatorInterface- Overrides:
removeByConditionin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity XML fileentityCondition- The EntityCondition object that specifies how to constrain this query- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
removeByCondition
public int removeByCondition(String entityName, EntityCondition entityCondition, boolean doCacheClear) throws GenericEntityException Description copied from class:GenericDelegatorRemoves/deletes Generic Entity records found by matching the EntityCondition.- Specified by:
removeByConditionin interfaceDelegatorInterface- Overrides:
removeByConditionin classGenericDelegator- Parameters:
entityName- The Name of the Entity as defined in the entity XML fileentityCondition- The EntityCondition object that specifies how to constrain this querydoCacheClear- boolean that specifies whether to clear cache entries for this value to be removed- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
removeByPrimaryKey
Description copied from class:GenericDelegatorRemove a Generic Entity corresponding to the primaryKey.- Specified by:
removeByPrimaryKeyin interfaceDelegatorInterface- Overrides:
removeByPrimaryKeyin classGenericDelegator- Parameters:
primaryKey- The primary key of the entity to remove.- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
removeByPrimaryKey
public int removeByPrimaryKey(GenericPK primaryKey, boolean doCacheClear) throws GenericEntityException Description copied from class:GenericDelegatorRemove a Generic Entity corresponding to the primaryKey.- Specified by:
removeByPrimaryKeyin interfaceDelegatorInterface- Overrides:
removeByPrimaryKeyin classGenericDelegator- 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 affected by this operation
- Throws:
GenericEntityException
-
removeRelated
Description copied from class:GenericDelegatorRemove the named Related Entity for the GenericValue from the persistent store.- Specified by:
removeRelatedin interfaceDelegatorInterface- Overrides:
removeRelatedin classGenericDelegator- 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 affected by this operation
- Throws:
GenericEntityException
-
removeRelated
public int removeRelated(String relationName, GenericValue value, boolean doCacheClear) throws GenericEntityException Description copied from class:GenericDelegatorRemove the named Related Entity for the GenericValue from the persistent store.- Specified by:
removeRelatedin interfaceDelegatorInterface- Overrides:
removeRelatedin classGenericDelegator- 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 entitydoCacheClear- boolean that specifies whether to clear cache entries for this value to be removed- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
removeValue
Description copied from class:GenericDelegatorRemove a Generic Value from the database.- Specified by:
removeValuein interfaceDelegatorInterface- Overrides:
removeValuein classGenericDelegator- Parameters:
value- The GenericValue object of the entity to remove.- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
removeValue
Description copied from class:GenericDelegatorRemove a Generic Value from the database.- Specified by:
removeValuein interfaceDelegatorInterface- Overrides:
removeValuein classGenericDelegator- 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 affected by this operation
- Throws:
GenericEntityException
-
setSequencer
Description copied from class:GenericDelegatorAllows you to pass a SequenceUtil class (possibly one that overrides the getNextSeqId method); if null is passed will effectively refresh the sequencer.- Specified by:
setSequencerin interfaceDelegatorInterface- Overrides:
setSequencerin classGenericDelegator- Parameters:
sequencer- the sequencer to set
-
store
Description copied from class:GenericDelegatorStore the Entity from the GenericValue to the persistent store.- Specified by:
storein interfaceDelegatorInterface- Overrides:
storein classGenericDelegator- Parameters:
value- GenericValue instance containing the entity- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
store
Description copied from class:GenericDelegatorStore the Entity from the GenericValue to the persistent store.- Specified by:
storein interfaceDelegatorInterface- Overrides:
storein classGenericDelegator- Parameters:
value- GenericValue instance containing the entitydoCacheClear- whether to automatically clear cache entries related to this operation- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
storeAll
Description copied from class:GenericDelegatorStore 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:
storeAllin interfaceDelegatorInterface- Overrides:
storeAllin classGenericDelegator- Parameters:
values- List of GenericValue instances containing the entities to store- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
storeAll
public int storeAll(List<? extends GenericValue> values, boolean doCacheClear) throws GenericEntityException Description copied from class:GenericDelegatorStore 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:
storeAllin interfaceDelegatorInterface- Overrides:
storeAllin classGenericDelegator- Parameters:
values- List of GenericValue instances containing the entities to storedoCacheClear- whether to automatically clear cache entries related to this operation- Returns:
- int representing number of rows affected by this operation
- Throws:
GenericEntityException
-
transform
public List<GenericValue> transform(String entityName, EntityCondition entityCondition, List<String> orderBy, String lockField, Transformation transformation) Description copied from interface:DelegatorInterfaceApplies the given transformation to any entities matching the given condition.- Specified by:
transformin interfaceDelegatorInterface- Overrides:
transformin classGenericDelegator- Parameters:
entityName- the type of entity to transform (required)entityCondition- the condition that selects the entities to transform (null means transform all)orderBy- the order in which the entities should be selected for updating (null means no ordering)lockField- the entity field to use for optimistic locking; the value of this field will be read between the SELECT and the UPDATE to determine whether another process has updated one of the target records in the meantime; if so, the transformation will be reapplied and another UPDATE attemptedtransformation- the transformation to apply (required)- Returns:
- the transformed entities in the order they were selected (never null)
-