public class SerializableEntityCache extends Object implements EntityCache
Constructor and Description |
---|
SerializableEntityCache(EntityModel model,
javax.cache.CacheManager cacheManager) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Evict all references from the cache.
|
protected <K,V> void |
configure(javax.cache.configuration.MutableConfiguration<K,V> configuration) |
boolean |
contains(Class<?> type,
Object key)
Check if a reference to an entity exists.
|
protected <K,T> javax.cache.Cache<K,io.requery.cache.SerializedEntity<T>> |
createCache(String cacheName,
Type<T> type) |
<T> T |
get(Class<T> type,
Object key)
Retrieve an existing entity if it exists in the cache.
|
protected String |
getCacheName(Type<?> type) |
void |
invalidate(Class<?> type)
Removes all references for the given type from the cache.
|
void |
invalidate(Class<?> type,
Object key)
Remove a reference to an entity from the cache.
|
<T> void |
put(Class<T> type,
Object key,
T value)
Put a reference to an entity.
|
public SerializableEntityCache(EntityModel model, javax.cache.CacheManager cacheManager)
protected <K,V> void configure(javax.cache.configuration.MutableConfiguration<K,V> configuration)
protected <K,T> javax.cache.Cache<K,io.requery.cache.SerializedEntity<T>> createCache(String cacheName, Type<T> type)
public <T> T get(Class<T> type, Object key)
EntityCache
get
in interface EntityCache
T
- entity typetype
- entity classkey
- entity keypublic <T> void put(Class<T> type, Object key, T value)
EntityCache
put
in interface EntityCache
T
- entity typetype
- entity classkey
- entity keyvalue
- entity referencepublic boolean contains(Class<?> type, Object key)
EntityCache
contains
in interface EntityCache
type
- entity classkey
- entity keypublic void invalidate(Class<?> type)
EntityCache
invalidate
in interface EntityCache
type
- entity classpublic void invalidate(Class<?> type, Object key)
EntityCache
invalidate
in interface EntityCache
type
- entity classkey
- entity keypublic void clear()
EntityCache
clear
in interface EntityCache