Package org.hibernate.cache
Class ReadOnlyCache
java.lang.Object
org.hibernate.cache.ReadOnlyCache
- All Implemented Interfaces:
CacheConcurrencyStrategy
Caches data that is never updated.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanafterInsert(Object key, Object value, Object version) Do nothing.booleanafterUpdate(Object key, Object value, Object version, SoftLock lock) Unsupported!voidclear()Evict all items from the cache immediately.voiddestroy()Clean up all resources.voidDo nothing.Attempt to retrieve an object from the cache.getCache()Get the wrapped cache implementationGet the cache region namebooleanDo nothing.Unsupported!booleanput(Object key, Object value, long timestamp, Object version, Comparator versionComparator, boolean minimalPut) Attempt to cache an object, after loading from the database.voidUnsupported!voidEvict an item from the cache immediately (without regard for transaction isolation).voidSet the underlying cache implementation.toString()booleanUnsupported!
-
Constructor Details
-
ReadOnlyCache
public ReadOnlyCache()
-
-
Method Details
-
setCache
Description copied from interface:CacheConcurrencyStrategySet the underlying cache implementation.- Specified by:
setCachein interfaceCacheConcurrencyStrategy- Parameters:
cache-
-
getCache
Description copied from interface:CacheConcurrencyStrategyGet the wrapped cache implementation- Specified by:
getCachein interfaceCacheConcurrencyStrategy
-
getRegionName
Description copied from interface:CacheConcurrencyStrategyGet the cache region name- Specified by:
getRegionNamein interfaceCacheConcurrencyStrategy
-
get
Description copied from interface:CacheConcurrencyStrategyAttempt to retrieve an object from the cache. Mainly used in attempting to resolve entities/collections from the second level cache.- Specified by:
getin interfaceCacheConcurrencyStrategy- Parameters:
key-timestamp- a timestamp prior to the transaction start time- Returns:
- the cached object or null
- Throws:
CacheException
-
lock
Unsupported!- Specified by:
lockin interfaceCacheConcurrencyStrategy- Parameters:
key-version-
-
put
public boolean put(Object key, Object value, long timestamp, Object version, Comparator versionComparator, boolean minimalPut) throws CacheException Description copied from interface:CacheConcurrencyStrategyAttempt to cache an object, after loading from the database.- Specified by:
putin interfaceCacheConcurrencyStrategy- Parameters:
key-value-timestamp- a timestamp prior to the transaction start timeversion- the item version numberversionComparator- a comparator used to compare version numbersminimalPut- indicates that the cache should avoid a put is the item is already cached- Returns:
- true if the object was successfully cached
- Throws:
CacheException
-
release
Unsupported!- Specified by:
releasein interfaceCacheConcurrencyStrategy- Parameters:
key-
-
clear
Description copied from interface:CacheConcurrencyStrategyEvict all items from the cache immediately.- Specified by:
clearin interfaceCacheConcurrencyStrategy- Throws:
CacheException
-
remove
Description copied from interface:CacheConcurrencyStrategyEvict an item from the cache immediately (without regard for transaction isolation).- Specified by:
removein interfaceCacheConcurrencyStrategy- Parameters:
key-- Throws:
CacheException
-
destroy
public void destroy()Description copied from interface:CacheConcurrencyStrategyClean up all resources.- Specified by:
destroyin interfaceCacheConcurrencyStrategy
-
afterUpdate
public boolean afterUpdate(Object key, Object value, Object version, SoftLock lock) throws CacheException Unsupported!- Specified by:
afterUpdatein interfaceCacheConcurrencyStrategy- Throws:
CacheException
-
afterInsert
Do nothing.- Specified by:
afterInsertin interfaceCacheConcurrencyStrategy- Throws:
CacheException
-
evict
Do nothing.- Specified by:
evictin interfaceCacheConcurrencyStrategy- Throws:
CacheException
-
insert
Do nothing.- Specified by:
insertin interfaceCacheConcurrencyStrategy
-
update
Unsupported!- Specified by:
updatein interfaceCacheConcurrencyStrategy
-
toString
-