public interface NaturalIdRegionAccessStrategy extends RegionAccessStrategy
insert(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, java.lang.Object) -> afterInsert(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, java.lang.Object)RegionAccessStrategy.lockItem(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, java.lang.Object) -> RegionAccessStrategy.remove(org.hibernate.engine.spi.SessionImplementor, java.lang.Object) -> update(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, java.lang.Object) -> afterUpdate(org.hibernate.engine.spi.SessionImplementor, 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)@putFromLoadRegionAccessStrategy.lockRegion() -> RegionAccessStrategy.removeAll() -> RegionAccessStrategy.unlockRegion(org.hibernate.cache.spi.access.SoftLock)
IMPORTANT : NaturalIds are not versioned so null will always be passed to the version parameter to:| Modifier and Type | Method and Description |
|---|---|
boolean |
afterInsert(SessionImplementor session,
Object key,
Object value)
Called after an item has been inserted (after the transaction completes),
instead of calling release().
|
boolean |
afterUpdate(SessionImplementor session,
Object key,
Object value,
SoftLock lock)
Called after an item has been updated (after the transaction completes),
instead of calling release().
|
Object |
generateCacheKey(Object[] naturalIdValues,
EntityPersister persister,
SessionImplementor session)
To create instances of NaturalIdCacheKey for this region, Hibernate will invoke this method
exclusively so that generated implementations can generate optimised keys.
|
Object[] |
getNaturalIdValues(Object cacheKey)
Performs reverse operation to
generateCacheKey(Object[], EntityPersister, SessionImplementor), returning
the original naturalIdValues. |
NaturalIdRegion |
getRegion()
Get the wrapped naturalId cache region
|
boolean |
insert(SessionImplementor session,
Object key,
Object value)
Called after an item has been inserted (before the transaction completes),
instead of calling evict().
|
boolean |
update(SessionImplementor session,
Object key,
Object value)
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, unlockRegionObject generateCacheKey(Object[] naturalIdValues, EntityPersister persister, SessionImplementor session)
naturalIdValues - the sequence of values which unequivocally identifies a cached element on this regionpersister - the persister of the element being cachedsession - Object[] getNaturalIdValues(Object cacheKey)
generateCacheKey(Object[], EntityPersister, SessionImplementor), returning
the original naturalIdValues.cacheKey - key returned from generateCacheKey(Object[], EntityPersister, SessionImplementor)NaturalIdRegion getRegion()
boolean insert(SessionImplementor session, Object key, Object value) throws CacheException
session - Current sessionkey - The item keyvalue - The itemCacheException - Propagated from underlying Regionboolean afterInsert(SessionImplementor session, Object key, Object value) throws CacheException
session - Current sessionkey - The item keyvalue - The itemCacheException - Propagated from underlying Regionboolean update(SessionImplementor session, Object key, Object value) throws CacheException
session - Current sessionkey - The item keyvalue - The itemCacheException - Propagated from underlying Regionboolean afterUpdate(SessionImplementor session, Object key, Object value, SoftLock lock) throws CacheException
session - Current sessionkey - The item keyvalue - The itemlock - The lock previously obtained from RegionAccessStrategy.lockItem(org.hibernate.engine.spi.SessionImplementor, java.lang.Object, java.lang.Object)CacheException - Propogated from underlying RegionCopyright © 2017 JBoss by Red Hat. All rights reserved.