public class EntityManagerSession extends Object
| Modifier and Type | Field and Description |
|---|---|
private Cache |
l2Cache
The l2 cache.
|
private static org.slf4j.Logger |
LOG
The Constant log.
|
private Map<Object,Object> |
sessionCache
cache is used to store objects retrieved in this EntityManager session.
|
| Constructor and Description |
|---|
EntityManagerSession(Cache cache)
Instantiates a new entity manager cache.
|
| Modifier and Type | Method and Description |
|---|---|
private String |
cacheKey(Class<?> clazz,
Object id)
Cache key.
|
void |
clear()
Clear.
|
Cache |
getL2Cache()
Gets the l2 cache.
|
protected <T> T |
lookup(Class<T> entityClass,
Object id)
Find in cache.
|
protected <T> void |
remove(Class<T> entityClass,
Object id)
Removes the.
|
protected <T> void |
remove(Class<T> entityClass,
Object id,
boolean spillOverToL2)
Removes the from cache.
|
void |
setL2Cache(Cache l2Cache)
Sets the l2 cache.
|
protected void |
store(Object id,
Object entity)
Store in L1 only.
|
protected void |
store(Object id,
Object entity,
boolean spillOverToL2)
Save to cache.
|
private static final org.slf4j.Logger LOG
private Map<Object,Object> sessionCache
private Cache l2Cache
public EntityManagerSession(Cache cache)
cache - the cacheprotected <T> T lookup(Class<T> entityClass, Object id)
T - the generic typeentityClass - the entity classid - the idprotected void store(Object id, Object entity)
id - the identity - the entityprotected void store(Object id, Object entity, boolean spillOverToL2)
id - the identity - the entityspillOverToL2 - the spill over to l2protected <T> void remove(Class<T> entityClass, Object id)
T - the generic typeentityClass - the entity classid - the idprotected <T> void remove(Class<T> entityClass, Object id, boolean spillOverToL2)
T - the generic typeentityClass - the entity classid - the idspillOverToL2 - the spill over to l2private String cacheKey(Class<?> clazz, Object id)
clazz - the clazzid - the idpublic final void clear()
public Cache getL2Cache()
public void setL2Cache(Cache l2Cache)
l2Cache - the l2Cache to setCopyright © 2015. All Rights Reserved.