Top Description Fields Constructors Methods
org.hibernate.cache

public Class ReadOnlyCache

extends Object
implements CacheConcurrencyStrategy
Class Inheritance
All Implemented Interfaces
org.hibernate.cache.CacheConcurrencyStrategy
Imports
java.util.Comparator, org.slf4j.Logger, .LoggerFactory, org.hibernate.cache.access.SoftLock

Deprecated

as a consequence of CacheConcurrencyStrategy being deprecated. See corresponding docs for further information.

Caches data that is never updated.
See Also
CacheConcurrencyStrategy

Field Summary

Modifier and TypeField and Description
private Cache
cache

Deprecated as a consequence of Cache being deprecated.
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public void
clear()

Implements org.hibernate.cache.CacheConcurrencyStrategy.clear.

Evict all items from the cache immediately.
public void
public void
public synchronized Object
get(Object key, long
a timestamp prior to the transaction start time
timestamp
)

Implements org.hibernate.cache.CacheConcurrencyStrategy.get.

Attempt to retrieve an object from the cache.
public Cache
getCache()

Implements org.hibernate.cache.CacheConcurrencyStrategy.getCache.

Deprecated as a consequence of Cache being deprecated.
Get the wrapped cache implementation
public String
public boolean
insert(Object key, Object value, Object currentVersion)

Implements org.hibernate.cache.CacheConcurrencyStrategy.insert.

Do nothing.
public SoftLock
public synchronized boolean
put(Object key, Object value, long
a timestamp prior to the transaction start time
timestamp
,
Object
the item version number
version
,
Comparator<T>
a comparator used to compare version numbers
versionComparator
,
boolean
indicates that the cache should avoid a put is the item is already cached
minimalPut
)

Implements org.hibernate.cache.CacheConcurrencyStrategy.put.

Attempt to cache an object, after loading from the database.
public void
public void
remove(Object key)

Implements org.hibernate.cache.CacheConcurrencyStrategy.remove.

Evict an item from the cache immediately (without regard for transaction isolation).
public void
setCache(Cache cache)

Implements org.hibernate.cache.CacheConcurrencyStrategy.setCache.

Deprecated as a consequence of Cache being deprecated.
Set the underlying cache implementation.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public boolean
update(Object key, Object value, Object currentVersion, Object previousVersion)

Implements org.hibernate.cache.CacheConcurrencyStrategy.update.

Unsupported!
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

cacheback to summary
private Cache cache

Deprecated

as a consequence of Cache being deprecated. See corresponding docs for further information.

logback to summary
private static final Logger log

Constructor Detail

ReadOnlyCacheback to summary
public ReadOnlyCache()

Method Detail

afterInsertback to summary
public boolean afterInsert(Object key, Object value, Object version) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.afterInsert.

Do nothing.

afterUpdateback to summary
public boolean afterUpdate(Object key, Object value, Object version, SoftLock lock) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.afterUpdate.

Unsupported!

clearback to summary
public void clear() throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.clear.

Doc from org.hibernate.cache.CacheConcurrencyStrategy.clear.

Evict all items from the cache immediately.

destroyback to summary
public void destroy()

Implements org.hibernate.cache.CacheConcurrencyStrategy.destroy.

Doc from org.hibernate.cache.CacheConcurrencyStrategy.destroy.

Clean up all resources.

evictback to summary
public void evict(Object key) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.evict.

Do nothing.

getback to summary
public synchronized Object get(Object key, long timestamp) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.get.

Doc from org.hibernate.cache.CacheConcurrencyStrategy.get.

Attempt to retrieve an object from the cache. Mainly used in attempting to resolve entities/collections from the second level cache.

Parameters
timestamp:long

a timestamp prior to the transaction start time

Returns:Object

the cached object or null

getCacheback to summary
public Cache getCache()

Implements org.hibernate.cache.CacheConcurrencyStrategy.getCache.

Doc from org.hibernate.cache.CacheConcurrencyStrategy.getCache.

Deprecated

as a consequence of Cache being deprecated. See corresponding docs for further information.

Get the wrapped cache implementation

getRegionNameback to summary
public String getRegionName()

Implements org.hibernate.cache.CacheConcurrencyStrategy.getRegionName.

Doc from org.hibernate.cache.CacheConcurrencyStrategy.getRegionName.

Get the cache region name

insertback to summary
public boolean insert(Object key, Object value, Object currentVersion)

Implements org.hibernate.cache.CacheConcurrencyStrategy.insert.

Do nothing.

lockback to summary
public SoftLock lock(Object key, Object version)

Implements org.hibernate.cache.CacheConcurrencyStrategy.lock.

Unsupported!

putback to summary
public synchronized boolean put(Object key, Object value, long timestamp, Object version, Comparator<T> versionComparator, boolean minimalPut) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.put.

Doc from org.hibernate.cache.CacheConcurrencyStrategy.put.

Attempt to cache an object, after loading from the database.

Parameters
timestamp:long

a timestamp prior to the transaction start time

version:Object

the item version number

versionComparator:Comparator<T>

a comparator used to compare version numbers

minimalPut:boolean

indicates that the cache should avoid a put is the item is already cached

Returns:boolean

true if the object was successfully cached

releaseback to summary
public void release(Object key, SoftLock lock)

Implements org.hibernate.cache.CacheConcurrencyStrategy.release.

Unsupported!

removeback to summary
public void remove(Object key) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.remove.

Doc from org.hibernate.cache.CacheConcurrencyStrategy.remove.

Evict an item from the cache immediately (without regard for transaction isolation).

setCacheback to summary
public void setCache(Cache cache)

Implements org.hibernate.cache.CacheConcurrencyStrategy.setCache.

Doc from org.hibernate.cache.CacheConcurrencyStrategy.setCache.

Deprecated

as a consequence of Cache being deprecated. See corresponding docs for further information.

Set the underlying cache implementation.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

updateback to summary
public boolean update(Object key, Object value, Object currentVersion, Object previousVersion)

Implements org.hibernate.cache.CacheConcurrencyStrategy.update.

Unsupported!