public interface EntityRegionAccessStrategy extends RegionAccessStrategy
insert(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, java.lang.Object, java.lang.Object)
-> afterInsert(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, java.lang.Object, java.lang.Object)
RegionAccessStrategy.lockItem(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, java.lang.Object)
-> update(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)
-> afterUpdate(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, org.hibernate.cache.spi.access.SoftLock)
RegionAccessStrategy.lockItem(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, java.lang.Object)
-> RegionAccessStrategy.remove(org.hibernate.engine.spi.SessionImplementor, java.lang.Object)
-> RegionAccessStrategy.unlockItem(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, org.hibernate.cache.spi.access.SoftLock)
@putFromLoad
RegionAccessStrategy.lockRegion()
-> RegionAccessStrategy.removeAll()
-> RegionAccessStrategy.unlockRegion(org.hibernate.cache.spi.access.SoftLock)
Modifier and Type | Method and Description |
---|---|
boolean |
afterInsert(SessionImplementor session,
Object key,
Object value,
Object version)
Called after an item has been inserted (after the transaction completes),
instead of calling release().
|
boolean |
afterUpdate(SessionImplementor session,
Object key,
Object value,
Object currentVersion,
Object previousVersion,
SoftLock lock)
Called after an item has been updated (after the transaction completes),
instead of calling release().
|
Object |
generateCacheKey(Object id,
EntityPersister persister,
SessionFactoryImplementor factory,
String tenantIdentifier)
To create instances of keys for this region, Hibernate will invoke this method
exclusively so that generated implementations can generate optimised keys.
|
Object |
getCacheKeyId(Object cacheKey)
Performs reverse operation to
generateCacheKey(Object, EntityPersister, SessionFactoryImplementor, String) |
EntityRegion |
getRegion()
Get the wrapped entity cache region
|
boolean |
insert(SessionImplementor session,
Object key,
Object value,
Object version)
Called after an item has been inserted (before the transaction completes),
instead of calling evict().
|
boolean |
update(SessionImplementor session,
Object key,
Object value,
Object currentVersion,
Object previousVersion)
Called after an item has been updated (before the transaction completes),
instead of calling evict().
|
evict, evictAll, get, lockItem, lockRegion, putFromLoad, putFromLoad, remove, removeAll, unlockItem, unlockRegion
Object generateCacheKey(Object id, EntityPersister persister, SessionFactoryImplementor factory, String tenantIdentifier)
id
- the primary identifier of the entitypersister
- the persister for the type for which a key is being generatedfactory
- a reference to the current SessionFactorytenantIdentifier
- the tenant id, or null if multi-tenancy is not being used.Object getCacheKeyId(Object cacheKey)
generateCacheKey(Object, EntityPersister, SessionFactoryImplementor, String)
cacheKey
- key previously returned from generateCacheKey(Object, EntityPersister, SessionFactoryImplementor, String)
generateCacheKey(Object, EntityPersister, SessionFactoryImplementor, String)
EntityRegion getRegion()
boolean insert(SessionImplementor session, Object key, Object value, Object version) throws CacheException
session
- Current sessionkey
- The item keyvalue
- The itemversion
- The item's version valueCacheException
- Propagated from underlying Region
boolean afterInsert(SessionImplementor session, Object key, Object value, Object version) throws CacheException
session
- Current sessionkey
- The item keyvalue
- The itemversion
- The item's version valueCacheException
- Propagated from underlying Region
boolean update(SessionImplementor session, Object key, Object value, Object currentVersion, Object previousVersion) throws CacheException
session
- Current sessionkey
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version valueCacheException
- Propagated from underlying Region
boolean afterUpdate(SessionImplementor session, Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws CacheException
session
- Current sessionkey
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version valuelock
- The lock previously obtained from RegionAccessStrategy.lockItem(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, java.lang.Object)
CacheException
- Propagated from underlying Region
Copyright © 2016 JBoss by Red Hat. All rights reserved.