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

public Class NaturalIdNonStrictReadWriteAccess

extends AbstractNaturalIdDataAccess
Class Inheritance
Imports
org.hibernate.cache.cfg.spi.NaturalIdDataCachingConfig, 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.NaturalIdDataAccess 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
)

Overrides org.hibernate.cache.spi.support.AbstractNaturalIdDataAccess.afterInsert.

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

Called afterQuery an item has been inserted (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
)

Overrides org.hibernate.cache.spi.support.AbstractNaturalIdDataAccess.insert.

Implements org.hibernate.cache.spi.access.NaturalIdDataAccess.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.AbstractNaturalIdDataAccess.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
)

Overrides org.hibernate.cache.spi.support.AbstractNaturalIdDataAccess.update.

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

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

Constructor Detail

NaturalIdNonStrictReadWriteAccessback to summary
public NaturalIdNonStrictReadWriteAccess(DomainDataRegion region, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, NaturalIdDataCachingConfig config)

Method Detail

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

Overrides org.hibernate.cache.spi.support.AbstractNaturalIdDataAccess.afterInsert.

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

Doc from org.hibernate.cache.spi.access.NaturalIdDataAccess.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

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)

Overrides org.hibernate.cache.spi.support.AbstractNaturalIdDataAccess.insert.

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

Doc from org.hibernate.cache.spi.access.NaturalIdDataAccess.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

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)

Overrides org.hibernate.cache.spi.support.AbstractNaturalIdDataAccess.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)

Overrides org.hibernate.cache.spi.support.AbstractNaturalIdDataAccess.update.

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

Doc from org.hibernate.cache.spi.access.NaturalIdDataAccess.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

Returns:boolean

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

Annotations
@Override