Top Description Fields Constructors Methods
org.hibernate.cache.spi.support

public Class EntityReadOnlyAccess

extends AbstractEntityDataAccess
Class Inheritance
Imports
org.hibernate.cache.cfg.spi.EntityDataCachingConfig, org.hibernate.cache.spi.CacheKeysFactory, .DomainDataRegion, .SecondLevelCacheLogger, org.hibernate.cache.spi.access.AccessType, .SoftLock, org.hibernate.engine.spi.SharedSessionContractImplementor, org.jboss.logging.Logger

Standard support for org.hibernate.cache.spi.access.EntityDataAccess using the AccessType#READ_ONLY access type.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
afterInsert(SharedSessionContractImplementor
Current session
session
,
Object
The item key
key
,
Object
The item
value
,
Object
The item's version value
version
)

Implements org.hibernate.cache.spi.access.EntityDataAccess.afterInsert.

Called afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release().
public boolean
afterUpdate(SharedSessionContractImplementor
Current session
session
,
Object
The item key
key
,
Object
The item
value
,
Object
The item's current version value
currentVersion
,
Object
The item's previous version value
previousVersion
,
SoftLock
The lock previously obtained from lockItem
lock
)

Implements org.hibernate.cache.spi.access.EntityDataAccess.afterUpdate.

Called afterQuery an item has been updated (afterQuery the transaction completes), instead of calling release().
public AccessType
public boolean
insert(SharedSessionContractImplementor
Current session
session
,
Object
The item key
key
,
Object
The item
value
,
Object
The item's version value
version
)

Implements org.hibernate.cache.spi.access.EntityDataAccess.insert.

Called afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict().
public void
unlockItem(SharedSessionContractImplementor
Current session.
session
,
Object
The item key
key
,
SoftLock
The lock previously obtained from lockItem
lock
)

Overrides org.hibernate.cache.spi.support.AbstractEntityDataAccess.unlockItem.

Implements org.hibernate.cache.spi.access.CachedDomainDataAccess.unlockItem.

Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion.
public boolean
update(SharedSessionContractImplementor
Current session
session
,
Object
The item key
key
,
Object
The item
value
,
Object
The item's current version value
currentVersion
,
Object
The item's previous version value
previousVersion
)

Implements org.hibernate.cache.spi.access.EntityDataAccess.update.

Called afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict().
Inherited from org.hibernate.cache.spi.support.AbstractEntityDataAccess:
generateCacheKeygetCacheKeyIdlockItemlockRegionunlockRegion

Field Detail

logback to summary
private static final Logger log

Hides org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess.log.

Constructor Detail

EntityReadOnlyAccessback to summary
public EntityReadOnlyAccess(DomainDataRegion region, CacheKeysFactory cacheKeysFactory, DomainDataStorageAccess storageAccess, EntityDataCachingConfig config)

Method Detail

afterInsertback to summary
public boolean afterInsert(SharedSessionContractImplementor session, Object key, Object value, Object version)

Implements org.hibernate.cache.spi.access.EntityDataAccess.afterInsert.

Doc from org.hibernate.cache.spi.access.EntityDataAccess.afterInsert.

Called afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.

Parameters
session:SharedSessionContractImplementor

Current session

key:Object

The item key

value:Object

The item

version:Object

The item's version value

Returns:boolean

Were the contents of the cache actual changed by this operation?

Annotations
@Override
afterUpdateback to summary
public boolean afterUpdate(SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock)

Implements org.hibernate.cache.spi.access.EntityDataAccess.afterUpdate.

Doc from org.hibernate.cache.spi.access.EntityDataAccess.afterUpdate.

Called afterQuery an item has been updated (afterQuery the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.

Parameters
session:SharedSessionContractImplementor

Current session

key:Object

The item key

value:Object

The item

currentVersion:Object

The item's current version value

previousVersion:Object

The item's previous version value

lock:SoftLock

The lock previously obtained from lockItem

Returns:boolean

Were the contents of the cache actually changed by this operation?

Annotations
@Override
getAccessTypeback to summary
public AccessType getAccessType()

Implements org.hibernate.cache.spi.access.CachedDomainDataAccess.getAccessType.

Doc from org.hibernate.cache.spi.access.CachedDomainDataAccess.getAccessType.

The type of access implemented

Annotations
@Override
insertback to summary
public boolean insert(SharedSessionContractImplementor session, Object key, Object value, Object version)

Implements org.hibernate.cache.spi.access.EntityDataAccess.insert.

Doc from org.hibernate.cache.spi.access.EntityDataAccess.insert.

Called afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.

Parameters
session:SharedSessionContractImplementor

Current session

key:Object

The item key

value:Object

The item

version:Object

The item's version value

Returns:boolean

Were the contents of the cache actually changed by this operation?

Annotations
@Override
unlockItemback to summary
public void unlockItem(SharedSessionContractImplementor session, Object key, SoftLock lock)

Overrides org.hibernate.cache.spi.support.AbstractEntityDataAccess.unlockItem.

Implements org.hibernate.cache.spi.access.CachedDomainDataAccess.unlockItem.

Doc from org.hibernate.cache.spi.access.CachedDomainDataAccess.unlockItem.

Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion. This method is used by "asynchronous" concurrency strategies.

Parameters
session:SharedSessionContractImplementor

Current session.

key:Object

The item key

lock:SoftLock

The lock previously obtained from lockItem

Annotations
@Override
updateback to summary
public boolean update(SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion)

Implements org.hibernate.cache.spi.access.EntityDataAccess.update.

Doc from org.hibernate.cache.spi.access.EntityDataAccess.update.

Called afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.

Parameters
session:SharedSessionContractImplementor

Current session

key:Object

The item key

value:Object

The item

currentVersion:Object

The item's current version value

previousVersion:Object

The item's previous version value

Returns:boolean

Were the contents of the cache actually changed by this operation?

Annotations
@Override