Package org.ofbiz.core.entity
Interface DelegatorInterface
- All Known Implementing Classes:
GenericDelegator,LockedDatabaseGenericDelegator
public interface DelegatorInterface
Delegator Interface
- Since:
- 2.0
- Version:
- $Revision: 1.1 $
- Author:
- Patrick Lightbody
-
Method Summary
Modifier and TypeMethodDescriptionvoidclearAllCacheLinesByDummyPK(Collection<? extends GenericEntity> dummyPKs) voidclearAllCacheLinesByValue(Collection<? extends GenericValue> values) voidvoidclearAllCaches(boolean distribute) voidclearCacheLine(String entityName, Map<String, ?> fields) voidclearCacheLine(GenericPK primaryKey) voidclearCacheLine(GenericPK primaryKey, boolean distribute) voidclearCacheLine(GenericValue value) voidclearCacheLine(GenericValue value, boolean distribute) voidclearCacheLineFlexible(GenericEntity dummyPK) voidclearCacheLineFlexible(GenericEntity dummyPK, boolean distribute) intintcountByAnd(String entityName, String fieldName, List<? extends EntityCondition> expressions, EntityFindOptions findOptions) intcountByCondition(String entityName, String fieldName, EntityCondition condition, EntityFindOptions findOptions) intcountByOr(String entityName, String fieldName, List<? extends EntityCondition> expressions, EntityFindOptions findOptions) create(GenericValue value) create(GenericValue value, boolean doCacheClear) findAllByPrimaryKeys(Collection<? extends GenericPK> primaryKeys) findAllByPrimaryKeysCache(Collection<? extends GenericPK> primaryKeys) findAllCache(String entityName) findAllCache(String entityName, List<String> orderBy) findByAnd(String entityName, List<? extends EntityCondition> expressions) findByAndCache(String entityName, Map<String, ?> fields) findByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) findByLike(String entityName, Map<String, ?> fields) findByOr(String entityName, List<? extends EntityCondition> expressions) findByPrimaryKey(String entityName, Map<String, ?> fields) findByPrimaryKey(GenericPK primaryKey) findByPrimaryKeyCache(String entityName, Map<String, ?> fields) findByPrimaryKeyCache(GenericPK primaryKey) findByPrimaryKeyPartial(GenericPK primaryKey, Set<String> keys) findListIteratorByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) findListIteratorByCondition(String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, Collection<String> fieldsToSelect, List<String> orderBy, EntityFindOptions findOptions) getEntityFieldType(ModelEntity entity, String type) getEntityFieldTypeNames(ModelEntity entity) getEntityGroupName(String entityName) getEntityHelper(String entityName) getEntityHelper(ModelEntity entity) getEntityHelperName(String entityName) getEntityHelperName(ModelEntity entity) getFieldNameSetsCopy(String entityName) getFromAllCache(String entityName) getFromAndCache(String entityName, Map<String, ?> fields) getFromAndCache(ModelEntity entity, Map<String, ?> fields) getFromPrimaryKeyCache(GenericPK primaryKey) getGroupHelperName(String groupName) getModelEntitiesByGroup(String groupName) getModelEntity(String entityName) getModelEntityMapByGroup(String groupName) getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo) getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo, List<String> orderBy) default LonggetNextSeqId(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) getRelated(String relationName, GenericValue value) getRelatedByAnd(String relationName, Map<String, ?> byAndFields, GenericValue value) getRelatedCache(String relationName, GenericValue value) getRelatedDummyPK(String relationName, Map<String, ?> byAndFields, GenericValue value) getRelatedOne(String relationName, GenericValue value) getRelatedOneCache(String relationName, GenericValue value) getRelatedOrderBy(String relationName, List<String> orderBy, GenericValue value) 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) voidrefresh(GenericValue value) voidrefresh(GenericValue value, boolean doCacheClear) voidintremoveAll(List<? extends GenericEntity> dummyPKs) intremoveAll(List<? extends GenericEntity> dummyPKs, boolean doCacheClear) intremoveByAnd(String entityName, Map<String, ?> fields) intremoveByAnd(String entityName, Map<String, ?> fields, boolean doCacheClear) intremoveByCondition(String entityName, EntityCondition entityCondition) intremoveByCondition(String entityName, EntityCondition entityCondition, boolean doCacheClear) intremoveByPrimaryKey(GenericPK primaryKey) intremoveByPrimaryKey(GenericPK primaryKey, boolean doCacheClear) intremoveRelated(String relationName, GenericValue value) intremoveRelated(String relationName, GenericValue value, boolean doCacheClear) intremoveValue(GenericValue value) intremoveValue(GenericValue value, boolean doCacheClear) voidsetSequencer(SequenceUtil sequencer) intstore(GenericValue value) intstore(GenericValue value, boolean doCacheClear) intstoreAll(List<? extends GenericValue> values) intstoreAll(List<? extends GenericValue> values, boolean doCacheClear) transform(String entityName, EntityCondition entityCondition, List<String> orderBy, String lockField, Transformation transformation) Applies the given transformation to any entities matching the given condition.
-
Method Details
-
getDelegatorName
String getDelegatorName() -
getModelReader
ModelReader getModelReader() -
getModelGroupReader
ModelGroupReader getModelGroupReader() -
getModelEntity
-
getEntityGroupName
-
getModelEntitiesByGroup
-
getModelEntityMapByGroup
-
getGroupHelperName
-
getEntityHelperName
-
getEntityHelperName
-
getEntityHelper
- Throws:
GenericEntityException
-
getEntityHelper
- Throws:
GenericEntityException
-
getEntityFieldType
- Throws:
GenericEntityException
-
getEntityFieldTypeNames
- Throws:
GenericEntityException
-
makeValue
-
makePK
-
create
- Throws:
GenericEntityException
-
create
- Throws:
GenericEntityException
-
create
- Throws:
GenericEntityException
-
create
- Throws:
GenericEntityException
-
create
- Throws:
GenericEntityException
-
findByPrimaryKey
- Throws:
GenericEntityException
-
findByPrimaryKeyCache
- Throws:
GenericEntityException
-
findByPrimaryKey
GenericValue findByPrimaryKey(String entityName, Map<String, ?> fields) throws GenericEntityException- Throws:
GenericEntityException
-
findByPrimaryKeyCache
GenericValue findByPrimaryKeyCache(String entityName, Map<String, ?> fields) throws GenericEntityException- Throws:
GenericEntityException
-
findByPrimaryKeyPartial
GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, Set<String> keys) throws GenericEntityException - Throws:
GenericEntityException
-
findAllByPrimaryKeys
List<GenericValue> findAllByPrimaryKeys(Collection<? extends GenericPK> primaryKeys) throws GenericEntityException - Throws:
GenericEntityException
-
findAllByPrimaryKeysCache
List<GenericValue> findAllByPrimaryKeysCache(Collection<? extends GenericPK> primaryKeys) throws GenericEntityException - Throws:
GenericEntityException
-
removeByPrimaryKey
- Throws:
GenericEntityException
-
removeByPrimaryKey
- Throws:
GenericEntityException
-
removeValue
- Throws:
GenericEntityException
-
removeValue
- Throws:
GenericEntityException
-
findAll
- Throws:
GenericEntityException
-
findAll
- Throws:
GenericEntityException
-
findAllCache
- Throws:
GenericEntityException
-
findAllCache
List<GenericValue> findAllCache(String entityName, List<String> orderBy) throws GenericEntityException - Throws:
GenericEntityException
-
findByAnd
- Throws:
GenericEntityException
-
findByOr
- Throws:
GenericEntityException
-
findByAnd
List<GenericValue> findByAnd(String entityName, Map<String, ?> fields, List<String> orderBy) throws GenericEntityException- Throws:
GenericEntityException
-
findByAnd
List<GenericValue> findByAnd(ModelEntity modelEntity, Map<String, ?> fields, List<String> orderBy) throws GenericEntityException- Throws:
GenericEntityException
-
findByOr
List<GenericValue> findByOr(String entityName, Map<String, ?> fields, List<String> orderBy) throws GenericEntityException- Throws:
GenericEntityException
-
findByAndCache
List<GenericValue> findByAndCache(String entityName, Map<String, ?> fields) throws GenericEntityException- Throws:
GenericEntityException
-
findByAndCache
List<GenericValue> findByAndCache(String entityName, Map<String, ?> fields, List<String> orderBy) throws GenericEntityException- Throws:
GenericEntityException
-
findByAnd
List<GenericValue> findByAnd(String entityName, List<? extends EntityCondition> expressions) throws GenericEntityException - Throws:
GenericEntityException
-
findByOr
List<GenericValue> findByOr(String entityName, List<? extends EntityCondition> expressions) throws GenericEntityException - Throws:
GenericEntityException
-
findByAnd
List<GenericValue> findByAnd(String entityName, List<? extends EntityCondition> expressions, List<String> orderBy) throws GenericEntityException - Throws:
GenericEntityException
-
findByOr
List<GenericValue> findByOr(String entityName, List<? extends EntityCondition> expressions, List<String> orderBy) throws GenericEntityException - Throws:
GenericEntityException
-
findByLike
List<GenericValue> findByLike(String entityName, Map<String, ?> fields) throws GenericEntityException- Throws:
GenericEntityException
-
findByLike
List<GenericValue> findByLike(String entityName, Map<String, ?> fields, List<String> orderBy) throws GenericEntityException- Throws:
GenericEntityException
-
findByCondition
List<GenericValue> findByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) throws GenericEntityException - Throws:
GenericEntityException
-
countByAnd
int countByAnd(String entityName, String fieldName, List<? extends EntityCondition> expressions, EntityFindOptions findOptions) throws GenericEntityException - Throws:
GenericEntityException
-
countByOr
int countByOr(String entityName, String fieldName, List<? extends EntityCondition> expressions, EntityFindOptions findOptions) throws GenericEntityException - Throws:
GenericEntityException
-
countByCondition
int countByCondition(String entityName, String fieldName, EntityCondition condition, EntityFindOptions findOptions) throws GenericEntityException - Throws:
GenericEntityException
-
countAll
- Throws:
GenericEntityException
-
findListIteratorByCondition
EntityListIterator findListIteratorByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) throws GenericEntityException - Throws:
GenericEntityException
-
findListIteratorByCondition
EntityListIterator findListIteratorByCondition(String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, Collection<String> fieldsToSelect, List<String> orderBy, EntityFindOptions findOptions) throws GenericEntityException - Throws:
GenericEntityException
-
removeByAnd
- Throws:
GenericEntityException
-
removeByAnd
int removeByAnd(String entityName, Map<String, ?> fields, boolean doCacheClear) throws GenericEntityException- Throws:
GenericEntityException
-
removeByCondition
int removeByCondition(String entityName, EntityCondition entityCondition) throws GenericEntityException - Throws:
GenericEntityException
-
removeByCondition
int removeByCondition(String entityName, EntityCondition entityCondition, boolean doCacheClear) throws GenericEntityException - Throws:
GenericEntityException
-
getMultiRelation
List<GenericValue> getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo, List<String> orderBy) throws GenericEntityException - Throws:
GenericEntityException
-
getMultiRelation
List<GenericValue> getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo) throws GenericEntityException - Throws:
GenericEntityException
-
getRelated
List<GenericValue> getRelated(String relationName, GenericValue value) throws GenericEntityException - Throws:
GenericEntityException
-
getRelatedByAnd
List<GenericValue> getRelatedByAnd(String relationName, Map<String, ?> byAndFields, GenericValue value) throws GenericEntityException- Throws:
GenericEntityException
-
getRelatedOrderBy
List<GenericValue> getRelatedOrderBy(String relationName, List<String> orderBy, GenericValue value) throws GenericEntityException - Throws:
GenericEntityException
-
getRelated
List<GenericValue> getRelated(String relationName, Map<String, ?> byAndFields, List<String> orderBy, GenericValue value) throws GenericEntityException- Throws:
GenericEntityException
-
getRelatedDummyPK
GenericPK getRelatedDummyPK(String relationName, Map<String, ?> byAndFields, GenericValue value) throws GenericEntityException- Throws:
GenericEntityException
-
getRelatedCache
List<GenericValue> getRelatedCache(String relationName, GenericValue value) throws GenericEntityException - Throws:
GenericEntityException
-
getRelatedOne
- Throws:
GenericEntityException
-
getRelatedOneCache
GenericValue getRelatedOneCache(String relationName, GenericValue value) throws GenericEntityException - Throws:
GenericEntityException
-
removeRelated
- Throws:
GenericEntityException
-
removeRelated
int removeRelated(String relationName, GenericValue value, boolean doCacheClear) throws GenericEntityException - Throws:
GenericEntityException
-
refresh
- Throws:
GenericEntityException
-
refresh
- Throws:
GenericEntityException
-
store
- Throws:
GenericEntityException
-
store
- Throws:
GenericEntityException
-
storeAll
- Throws:
GenericEntityException
-
storeAll
int storeAll(List<? extends GenericValue> values, boolean doCacheClear) throws GenericEntityException - Throws:
GenericEntityException
-
removeAll
- Throws:
GenericEntityException
-
removeAll
int removeAll(List<? extends GenericEntity> dummyPKs, boolean doCacheClear) throws GenericEntityException - Throws:
GenericEntityException
-
clearAllCaches
void clearAllCaches() -
clearAllCaches
void clearAllCaches(boolean distribute) -
clearCacheLine
-
clearCacheLineFlexible
-
clearCacheLineFlexible
-
clearCacheLine
-
clearCacheLine
-
clearCacheLine
-
clearCacheLine
-
getFieldNameSetsCopy
-
clearAllCacheLinesByDummyPK
-
clearAllCacheLinesByValue
-
getFromPrimaryKeyCache
-
getFromAllCache
-
getFromAndCache
-
getFromAndCache
-
putInPrimaryKeyCache
-
putAllInPrimaryKeyCache
-
putInAllCache
-
putInAllCache
-
putInAndCache
-
putInAndCache
-
getNextSeqId
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.From v1.3.0 this is equivalent of calling
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
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.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- 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
- Since:
- v1.3.0
-
setSequencer
-
refreshSequencer
void refreshSequencer() -
getPrimaryKeyCache
UtilCache<GenericEntity,GenericValue> getPrimaryKeyCache() -
getAndCache
UtilCache<GenericPK,List<GenericValue>> getAndCache() -
getAllCache
UtilCache<String,List<GenericValue>> getAllCache() -
getSqlEscapeHelper
SqlEscapeHelper getSqlEscapeHelper() -
transform
List<GenericValue> transform(String entityName, EntityCondition entityCondition, List<String> orderBy, String lockField, Transformation transformation) throws GenericEntityException Applies the given transformation to any entities matching the given condition.- 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)
- Throws:
GenericEntityException- Since:
- 1.0.41
-