Class AbstractDataManager<EntityImpl extends Entity>
java.lang.Object
org.flowable.common.engine.impl.db.AbstractDataManager<EntityImpl>
- All Implemented Interfaces:
DataManager<EntityImpl>
- Direct Known Subclasses:
AbstractCmmnDataManager,AbstractDmnDataManager,AbstractEventDataManager,AbstractEventSubscriptionDataManager,AbstractIdmDataManager,AbstractProcessDataManager,MybatisBatchDataManager,MybatisBatchPartDataManager,MybatisByteArrayDataManager,MybatisDeadLetterJobDataManager,MybatisEntityLinkDataManager,MybatisExternalWorkerJobDataManager,MybatisHistoricEntityLinkDataManager,MybatisHistoricIdentityLinkDataManager,MybatisHistoricTaskInstanceDataManager,MyBatisHistoricTaskLogEntryDataManager,MybatisHistoricVariableInstanceDataManager,MybatisHistoryJobDataManager,MybatisIdentityLinkDataManager,MybatisJobDataManager,MybatisPropertyDataManager,MybatisSuspendedJobDataManager,MybatisTaskDataManager,MybatisTimerJobDataManager,MybatisVariableInstanceDataManager
public abstract class AbstractDataManager<EntityImpl extends Entity>
extends Object
implements DataManager<EntityImpl>
- Author:
- Joram Barrez, Tijs Rademakers
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbulkDelete(String statement, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, Object parameter) Does a bulk delete, but also uses the providedCachedEntityMatcherto look in the cache to mark the cached entities as deleted.protected voidbulkDeleteEntities(String statement, List<EntityImpl> entities) protected voidbulkUpdateEntities(String statement, Map<String, Object> parameters, String collectionNameInSqlStatement, List<EntityImpl> entities) createSafeInValuesList(Collection<String> values) voiddelete(EntityImpl entity) voidprotected voiddeleteCachedEntities(DbSqlSession dbSqlSession, Collection<CachedEntity> cachedObjects, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, Object parameter) protected voiddeleteCachedEntities(DbSqlSession dbSqlSession, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, Object parameter) protected voidexecuteChangeWithInClause(List<EntityImpl> entities, Consumer<List<EntityImpl>> consumer) protected EntityImplfindByQuery(String selectQuery, Object parameter) protected CommandContextprotected DbSqlSessionprotected EntityImplgetEntity(String selectQuery, Object parameter, SingleCachedEntityMatcher<EntityImpl> cachedEntityMatcher, boolean checkDatabase) protected EntityCacheprotected abstract IdGeneratorprotected List<EntityImpl>protected List<EntityImpl>getList(String dbQueryName, Object parameter, CachedEntityMatcher<EntityImpl> cachedEntityMatcher) protected List<EntityImpl>getList(String dbQueryName, Object parameter, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, boolean checkCache) Gets a list by querying the database and the cache usingCachedEntityMatcher.protected List<EntityImpl>getList(DbSqlSession dbSqlSession, String dbQueryName, Object parameter, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, boolean checkCache) protected List<EntityImpl>getList(DbSqlSession dbSqlSession, String dbQueryName, Object parameter, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, boolean checkCache, boolean includeDeleted) protected List<EntityImpl>getListFromCache(CachedEntityMatcher<EntityImpl> entityMatcher, Object parameter) protected List<EntityImpl>getListFromCache(CachedEntityMatcher<EntityImpl> entityMatcher, Object parameter, boolean includeDeletedEntities) abstract Class<? extends EntityImpl>List<Class<? extends EntityImpl>>protected <T> TgetSession(Class<T> sessionClass) voidinsert(EntityImpl entity) protected booleanisEntityInserted(DbSqlSession dbSqlSession, String entityLogicalName, String entityId) update(EntityImpl entity) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.flowable.common.engine.impl.persistence.entity.data.DataManager
create
-
Field Details
-
MAX_ENTRIES_IN_CLAUSE
public static final int MAX_ENTRIES_IN_CLAUSE- See Also:
-
-
Constructor Details
-
AbstractDataManager
public AbstractDataManager()
-
-
Method Details
-
getManagedEntityClass
-
getManagedEntitySubClasses
-
getCommandContext
-
getSession
-
getDbSqlSession
-
getEntityCache
-
findById
- Specified by:
findByIdin interfaceDataManager<EntityImpl extends Entity>
-
insert
- Specified by:
insertin interfaceDataManager<EntityImpl extends Entity>
-
update
- Specified by:
updatein interfaceDataManager<EntityImpl extends Entity>
-
delete
- Specified by:
deletein interfaceDataManager<EntityImpl extends Entity>
-
delete
- Specified by:
deletein interfaceDataManager<EntityImpl extends Entity>
-
findByQuery
-
getList
-
getEntity
protected EntityImpl getEntity(String selectQuery, Object parameter, SingleCachedEntityMatcher<EntityImpl> cachedEntityMatcher, boolean checkDatabase) -
getList
protected List<EntityImpl> getList(String dbQueryName, Object parameter, CachedEntityMatcher<EntityImpl> cachedEntityMatcher) -
getList
protected List<EntityImpl> getList(String dbQueryName, Object parameter, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, boolean checkCache) Gets a list by querying the database and the cache usingCachedEntityMatcher. First, the entities are fetched from the database using the provided query. The cache is then queried for the entities of the same type. If an entity matches theCachedEntityMatchercondition, it replaces the entity from the database (as it is newer).- Parameters:
dbQueryName- The query name that needs to be executed.parameter- The parameters for the query.cachedEntityMatcher- The matcher used to determine which entities from the cache needs to be retainedcheckCache- If false, no cache check will be done, and the returned list will simply be the list from the database.
-
getList
protected List<EntityImpl> getList(DbSqlSession dbSqlSession, String dbQueryName, Object parameter, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, boolean checkCache) -
getList
protected List<EntityImpl> getList(DbSqlSession dbSqlSession, String dbQueryName, Object parameter, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, boolean checkCache, boolean includeDeleted) -
getListFromCache
protected List<EntityImpl> getListFromCache(CachedEntityMatcher<EntityImpl> entityMatcher, Object parameter) -
getListFromCache
protected List<EntityImpl> getListFromCache(CachedEntityMatcher<EntityImpl> entityMatcher, Object parameter, boolean includeDeletedEntities) -
bulkDelete
public void bulkDelete(String statement, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, Object parameter) Does a bulk delete, but also uses the providedCachedEntityMatcherto look in the cache to mark the cached entities as deleted. (This is necessary if entities are inserted and deleted in the same operation). -
deleteCachedEntities
protected void deleteCachedEntities(DbSqlSession dbSqlSession, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, Object parameter) -
deleteCachedEntities
protected void deleteCachedEntities(DbSqlSession dbSqlSession, Collection<CachedEntity> cachedObjects, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, Object parameter) -
createSafeInValuesList
-
executeChangeWithInClause
protected void executeChangeWithInClause(List<EntityImpl> entities, Consumer<List<EntityImpl>> consumer) -
bulkDeleteEntities
-
bulkUpdateEntities
-
isEntityInserted
protected boolean isEntityInserted(DbSqlSession dbSqlSession, String entityLogicalName, String entityId) -
getIdGenerator
-