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 TypeMethodDescriptionvoid
bulkDelete
(String statement, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, Object parameter) Does a bulk delete, but also uses the providedCachedEntityMatcher
to look in the cache to mark the cached entities as deleted.protected void
bulkDeleteEntities
(String statement, List<EntityImpl> entities) protected void
bulkUpdateEntities
(String statement, Map<String, Object> parameters, String collectionNameInSqlStatement, List<EntityImpl> entities) createSafeInValuesList
(Collection<String> values) void
delete
(EntityImpl entity) void
protected void
deleteCachedEntities
(DbSqlSession dbSqlSession, Collection<CachedEntity> cachedObjects, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, Object parameter) protected void
deleteCachedEntities
(DbSqlSession dbSqlSession, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, Object parameter) protected void
executeChangeWithInClause
(List<EntityImpl> entities, Consumer<List<EntityImpl>> consumer) protected EntityImpl
findByQuery
(String selectQuery, Object parameter) protected CommandContext
protected DbSqlSession
protected EntityImpl
getEntity
(String selectQuery, Object parameter, SingleCachedEntityMatcher<EntityImpl> cachedEntityMatcher, boolean checkDatabase) protected EntityCache
protected abstract IdGenerator
protected 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> T
getSession
(Class<T> sessionClass) void
insert
(EntityImpl entity) protected boolean
isEntityInserted
(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, wait
Methods 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:
findById
in interfaceDataManager<EntityImpl extends Entity>
-
insert
- Specified by:
insert
in interfaceDataManager<EntityImpl extends Entity>
-
update
- Specified by:
update
in interfaceDataManager<EntityImpl extends Entity>
-
delete
- Specified by:
delete
in interfaceDataManager<EntityImpl extends Entity>
-
delete
- Specified by:
delete
in 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 theCachedEntityMatcher
condition, 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 providedCachedEntityMatcher
to 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
-