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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Optional interface caching implementors can implement in their CachedDomainDataAccess impls to automatically have them destroyed when this region is destroyed -
Constructor Summary
ConstructorsConstructorDescriptionAbstractDomainDataRegion
(DomainDataRegionConfig regionConfig, RegionFactory regionFactory, CacheKeysFactory defaultKeysFactory, DomainDataRegionBuildingContext buildingContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all data cached in the regionprotected 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.void
destroy()
The "end state" contract of the region's lifecycle.protected abstract CollectionDataAccess
generateCollectionAccess
(CollectionDataCachingConfig cachingConfig) protected abstract EntityDataAccess
generateEntityAccess
(EntityDataCachingConfig entityAccessConfig) protected abstract NaturalIdDataAccess
generateNaturalIdAccess
(NaturalIdDataCachingConfig naturalIdAccessConfig) getCollectionDataAccess
(NavigableRole collectionRole) Build aCollectionDataAccess
instance representing access to destructured collection data stored in this cache region.getEntityDataAccess
(NavigableRole rootEntityRole) Build aEntityDataAccess
instance representing access to destructured entity data stored in this cache region.getNaturalIdDataAccess
(NavigableRole rootEntityRole) Build aNaturalIdDataAccess
instance representing access to natural id mappings stored in this cache region.protected void
releaseDataAccess
(CollectionDataAccess cacheAccess) protected void
releaseDataAccess
(EntityDataAccess cacheAccess) protected void
releaseDataAccess
(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 Details
-
AbstractDomainDataRegion
public AbstractDomainDataRegion(DomainDataRegionConfig regionConfig, RegionFactory regionFactory, CacheKeysFactory defaultKeysFactory, DomainDataRegionBuildingContext buildingContext)
-
-
Method Details
-
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
-
getEffectiveKeysFactory
-
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:Region
Clear all data cached in the region -
releaseDataAccess
-
releaseDataAccess
-
releaseDataAccess
-
destroy
Description copied from interface:Region
The "end state" contract of the region's lifecycle. Called duringSessionFactory.close()
to give the region a chance to cleanup.- Specified by:
destroy
in interfaceRegion
- Throws:
CacheException
- Indicates problem shutting down
-