public class JPADataStoreCache extends Object implements javax.persistence.Cache
Constructor and Description |
---|
JPADataStoreCache(org.datanucleus.PersistenceNucleusContext nucleusCtx,
org.datanucleus.cache.Level2Cache cache)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Class cls,
Object pk)
Accessor for whether the object with specified PK is contained in the cache.
|
void |
evict(Class cls)
Evict the parameter instance from the second-level cache.
|
void |
evict(Class cls,
Object pk)
Evict the parameter instance from the second-level cache.
|
void |
evictAll()
Evict all instances from the second-level cache.
|
org.datanucleus.cache.Level2Cache |
getLevel2Cache()
Accessor for the underlying Level 2 cache.
|
<T> T |
unwrap(Class<T> cls)
Return an object of the specified type to allow access to the provider-specific API.
|
public JPADataStoreCache(org.datanucleus.PersistenceNucleusContext nucleusCtx, org.datanucleus.cache.Level2Cache cache)
nucleusCtx
- Contextcache
- Level 2 Cache TODO Remove this arg and just use nucleusCtx.getLevel2Cache()public org.datanucleus.cache.Level2Cache getLevel2Cache()
public boolean contains(Class cls, Object pk)
contains
in interface javax.persistence.Cache
cls
- The classpk
- PK of the instance to evict.public void evictAll()
evictAll
in interface javax.persistence.Cache
public void evict(Class cls)
evict
in interface javax.persistence.Cache
cls
- Class of which to evict all objectspublic void evict(Class cls, Object pk)
evict
in interface javax.persistence.Cache
cls
- Class of which to evict the objectpk
- PK of the instance to evict.public <T> T unwrap(Class<T> cls)
unwrap
in interface javax.persistence.Cache
cls
- the class of the object to be returned. This is normally either the underlying Cache implementation class or an interface that it implements.javax.persistence.PersistenceException
- if the provider does not support the call.Copyright © 2020. All rights reserved.