Package org.hibernate.cache.spi.support
Class AbstractDomainDataRegion
- java.lang.Object
-
- org.hibernate.cache.spi.support.AbstractRegion
-
- org.hibernate.cache.spi.support.AbstractDomainDataRegion
-
- All Implemented Interfaces:
DomainDataRegion,Region
- Direct Known Subclasses:
DomainDataRegionTemplate
public abstract class AbstractDomainDataRegion extends AbstractRegion implements DomainDataRegion
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAbstractDomainDataRegion.DestructibleOptional interface caching implementors can implement in their CachedDomainDataAccess impls to automatically have them destroyed when this region is destroyed
-
Constructor Summary
Constructors Constructor Description AbstractDomainDataRegion(DomainDataRegionConfig regionConfig, RegionFactory regionFactory, CacheKeysFactory defaultKeysFactory, DomainDataRegionBuildingContext buildingContext)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclear()Clear all data cached in the regionprotected voidcompleteInstantiation(DomainDataRegionConfig regionConfig, DomainDataRegionBuildingContext buildingContext)Should be called at the end of the subtype's constructor, or at least after the `#super(...)` (aka, this type's constructor) call.voiddestroy()The "end state" contract of the region's lifecycle.protected abstract CollectionDataAccessgenerateCollectionAccess(CollectionDataCachingConfig cachingConfig)protected abstract EntityDataAccessgenerateEntityAccess(EntityDataCachingConfig entityAccessConfig)protected abstract NaturalIdDataAccessgenerateNaturalIdAccess(NaturalIdDataCachingConfig naturalIdAccessConfig)CollectionDataAccessgetCollectionDataAccess(NavigableRole collectionRole)Build a CollectionRegionAccess instance representing access to collection data stored in this cache region using the given AccessType.CacheKeysFactorygetEffectiveKeysFactory()EntityDataAccessgetEntityDataAccess(NavigableRole rootEntityRole)Build a EntityRegionAccess instance representing access to entity data stored in this cache region using the given AccessType.NaturalIdDataAccessgetNaturalIdDataAccess(NavigableRole rootEntityRole)Build a NaturalIdRegionAccess instance representing access to natural-id data stored in this cache region using the given AccessType.SessionFactoryImplementorgetSessionFactory()protected voidreleaseDataAccess(CollectionDataAccess cacheAccess)protected voidreleaseDataAccess(EntityDataAccess cacheAccess)protected voidreleaseDataAccess(NaturalIdDataAccess cacheAccess)-
Methods inherited from class org.hibernate.cache.spi.support.AbstractRegion
getName, getRegionFactory
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.cache.spi.Region
getName, getRegionFactory
-
-
-
-
Constructor Detail
-
AbstractDomainDataRegion
public AbstractDomainDataRegion(DomainDataRegionConfig regionConfig, RegionFactory regionFactory, CacheKeysFactory defaultKeysFactory, DomainDataRegionBuildingContext buildingContext)
-
-
Method Detail
-
completeInstantiation
protected void completeInstantiation(DomainDataRegionConfig regionConfig, DomainDataRegionBuildingContext buildingContext)
Should be called at the end of the subtype's constructor, or at least after the `#super(...)` (aka, this type's constructor) call. It's a timing issue - we need access to the DomainDataStorageAccess in DomainDataRegionTemplate but in methods initiated (atm) from AbstractDomainDataRegion's constructor
-
getSessionFactory
public SessionFactoryImplementor getSessionFactory()
-
getEffectiveKeysFactory
public CacheKeysFactory getEffectiveKeysFactory()
-
getEntityDataAccess
public EntityDataAccess getEntityDataAccess(NavigableRole rootEntityRole)
Description copied from interface:DomainDataRegionBuild a EntityRegionAccess instance representing access to entity data stored in this cache region using the given AccessType.- Specified by:
getEntityDataAccessin interfaceDomainDataRegion- Parameters:
rootEntityRole- The root entity name for the hierarchy whose data we want to access
-
getNaturalIdDataAccess
public NaturalIdDataAccess getNaturalIdDataAccess(NavigableRole rootEntityRole)
Description copied from interface:DomainDataRegionBuild a NaturalIdRegionAccess instance representing access to natural-id data stored in this cache region using the given AccessType.- Specified by:
getNaturalIdDataAccessin interfaceDomainDataRegion- Parameters:
rootEntityRole- The NavigableRole of the root entity whose natural-id data we want to access
-
getCollectionDataAccess
public CollectionDataAccess getCollectionDataAccess(NavigableRole collectionRole)
Description copied from interface:DomainDataRegionBuild a CollectionRegionAccess instance representing access to collection data stored in this cache region using the given AccessType.- Specified by:
getCollectionDataAccessin interfaceDomainDataRegion- Parameters:
collectionRole- The NavigableRole of the collection whose data we want to access
-
generateEntityAccess
protected abstract EntityDataAccess generateEntityAccess(EntityDataCachingConfig entityAccessConfig)
-
generateCollectionAccess
protected abstract CollectionDataAccess generateCollectionAccess(CollectionDataCachingConfig cachingConfig)
-
generateNaturalIdAccess
protected abstract NaturalIdDataAccess generateNaturalIdAccess(NaturalIdDataCachingConfig naturalIdAccessConfig)
-
clear
public void clear()
Description copied from interface:RegionClear all data cached in the region
-
releaseDataAccess
protected void releaseDataAccess(EntityDataAccess cacheAccess)
-
releaseDataAccess
protected void releaseDataAccess(NaturalIdDataAccess cacheAccess)
-
releaseDataAccess
protected void releaseDataAccess(CollectionDataAccess cacheAccess)
-
destroy
public void destroy() throws CacheExceptionDescription copied from interface:RegionThe "end state" contract of the region's lifecycle. Called duringSessionFactory.close()to give the region a chance to cleanup.- Specified by:
destroyin interfaceRegion- Throws:
CacheException- Indicates problem shutting down
-
-