Interface EntityCache
- All Superinterfaces:
Session
- All Known Implementing Classes:
EntityCacheImpl
-
Method Summary
Modifier and TypeMethodDescriptionvoidcacheRemove(Class<?> entityClass, String entityId) Removes theEntityof the given type with the given id from the cache.<T> List<T> findInCache(Class<T> entityClass) Returns all cachedEntityinstances of a given type.<T> TfindInCache(Class<T> entityClass, String id) Returns the cachedEntityinstance of the given class with the provided id.<T> Collection<CachedEntity> findInCacheAsCachedObjects(Class<T> entityClass) Returns allCachedEntityinstances for the given type.Map<Class<?>, Map<String, CachedEntity>> Returns all cachedEntityinstances as a map with following structure: { entityClassName, {entityId, entity} }Adds the givesEntityto the cache.
-
Method Details
-
getAllCachedEntities
-
put
Adds the givesEntityto the cache.- Parameters:
entity- TheEntityinstancestoreState- If true, the current stateEntity.getPersistentState()will be stored for future diffing. Note that, if false, theEntitywill always be seen as changed.- Returns:
- Returns a
CachedEntityinstance, which can be enriched later on.
-
findInCache
-
findInCache
-
findInCacheAsCachedObjects
Returns allCachedEntityinstances for the given type. The difference withfindInCache(Class)is that here the wholeCachedEntityis returned, which gives access to the persistent state at the moment of putting it in the cache. -
cacheRemove
-