Class EntityCacheImpl
java.lang.Object
org.flowable.common.engine.impl.persistence.cache.EntityCacheImpl
- All Implemented Interfaces:
Session
,EntityCache
- Author:
- Joram Barrez
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cacheRemove
(Class<?> entityClass, String entityId) Removes theEntity
of the given type with the given id from the cache.void
close()
protected Map<String,
CachedEntity> findClassCacheByCheckingSubclasses
(Class<?> entityClass) <T> List<T>
findInCache
(Class<T> entityClass) Returns all cachedEntity
instances of a given type.<T> T
findInCache
(Class<T> entityClass, String id) Returns the cachedEntity
instance of the given class with the provided id.<T> Collection<CachedEntity>
findInCacheAsCachedObjects
(Class<T> entityClass) Returns allCachedEntity
instances for the given type.void
flush()
Map<Class<?>,
Map<String, CachedEntity>> Returns all cachedEntity
instances as a map with following structure: { entityClassName, {entityId, entity} }Adds the givesEntity
to the cache.
-
Field Details
-
cachedObjects
-
-
Constructor Details
-
EntityCacheImpl
public EntityCacheImpl()
-
-
Method Details
-
put
Description copied from interface:EntityCache
Adds the givesEntity
to the cache.- Specified by:
put
in interfaceEntityCache
- Parameters:
entity
- TheEntity
instancestoreState
- If true, the current stateEntity.getPersistentState()
will be stored for future diffing. Note that, if false, theEntity
will always be seen as changed.- Returns:
- Returns a
CachedEntity
instance, which can be enriched later on.
-
findInCache
Description copied from interface:EntityCache
Returns the cachedEntity
instance of the given class with the provided id. Returns null if such aEntity
cannot be found.- Specified by:
findInCache
in interfaceEntityCache
-
findClassCacheByCheckingSubclasses
-
cacheRemove
Description copied from interface:EntityCache
Removes theEntity
of the given type with the given id from the cache.- Specified by:
cacheRemove
in interfaceEntityCache
-
findInCacheAsCachedObjects
Description copied from interface:EntityCache
Returns allCachedEntity
instances for the given type. The difference withEntityCache.findInCache(Class)
is that here the wholeCachedEntity
is returned, which gives access to the persistent state at the moment of putting it in the cache.- Specified by:
findInCacheAsCachedObjects
in interfaceEntityCache
-
findInCache
Description copied from interface:EntityCache
Returns all cachedEntity
instances of a given type. Returns an empty list if no instances of the given type exist.- Specified by:
findInCache
in interfaceEntityCache
-
getAllCachedEntities
Description copied from interface:EntityCache
Returns all cachedEntity
instances as a map with following structure: { entityClassName, {entityId, entity} }- Specified by:
getAllCachedEntities
in interfaceEntityCache
-
close
public void close() -
flush
public void flush()
-