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

public Class EntityNonStrictReadWriteAccess

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

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

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
remove(SharedSessionContractImplementor
Current session.
session
,
Object
The key of the item to remove
key
)

Overrides org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess.remove.

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

Called afterQuery an item has become stale (beforeQuery the transaction completes).
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.

Since this is a non-strict read/write strategy item locking is not used.
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

Constructor Detail

EntityNonStrictReadWriteAccessback to summary
public EntityNonStrictReadWriteAccess(DomainDataRegion domainDataRegion, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, EntityDataCachingConfig entityAccessConfig)

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
removeback to summary
public void remove(SharedSessionContractImplementor session, Object key)

Overrides org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess.remove.

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

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

Called afterQuery an item has become stale (beforeQuery the transaction completes). This method is used by "synchronous" concurrency strategies.

Parameters
session:SharedSessionContractImplementor

Current session.

key:Object

The key of the item to remove

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

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

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

Since this is a non-strict read/write strategy item locking is not used.

Parameters
session:SharedSessionContractImplementor

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

Current session.

key:Object

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

The item key

lock:SoftLock

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

The lock previously obtained from lockItem

Annotations
@Override
Exceptions
CacheException:

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

Propagated from underlying cache provider

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