public interface CollectionRegionAccessStrategy extends RegionAccessStrategy
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)
There is another usage pattern that is used to invalidate entries
after performing "bulk" HQL/SQL operations:
RegionAccessStrategy.lockRegion()
-> RegionAccessStrategy.removeAll()
-> RegionAccessStrategy.unlockRegion(org.hibernate.cache.spi.access.SoftLock)
Modifier and Type | Method and Description |
---|---|
Object |
generateCacheKey(Object id,
CollectionPersister persister,
SessionFactoryImplementor factory,
String tenantIdentifier)
To create instances of CollectionCacheKey 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, CollectionPersister, SessionFactoryImplementor, String) |
CollectionRegion |
getRegion()
Get the wrapped collection cache region
|
evict, evictAll, get, lockItem, lockRegion, putFromLoad, putFromLoad, remove, removeAll, unlockItem, unlockRegion
Object generateCacheKey(Object id, CollectionPersister persister, SessionFactoryImplementor factory, String tenantIdentifier)
id
- the primary identifier of the Collectionpersister
- 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, CollectionPersister, SessionFactoryImplementor, String)
cacheKey
- key previously returned from generateCacheKey(Object, CollectionPersister, SessionFactoryImplementor, String)
generateCacheKey(Object, CollectionPersister, SessionFactoryImplementor, String)
CollectionRegion getRegion()
Copyright © 2016 JBoss by Red Hat. All rights reserved.