public class HibernateRegionFactory extends Object implements org.hibernate.cache.spi.RegionFactory
Following Hibernate settings should be specified to enable second level cache and to use this region factory for caching:
hibernate.cache.use_second_level_cache=true hibernate.cache.region.factory_class=org.apache.ignite.cache.hibernate.HibernateRegionFactoryNote that before region factory is started you need to start properly configured Ignite node in the same JVM. For example to start Ignite node one of loader provided in
org.apache.ignite.grid.startup package can be used.
Name of Ignite instance to be used for region factory must be specified as following Hibernate property:
org.apache.ignite.hibernate.ignite_instance_name=<Ignite instance name>Each Hibernate cache region must be associated with some
IgniteInternalCache, by default it is assumed that
for each cache region there is a IgniteInternalCache with the same name. Also it is possible to define
region to cache mapping using properties with prefix org.apache.ignite.hibernate.region_cache.
For example if for region with name "region1" cache with name "cache1" should be used then following
Hibernate property should be specified:
org.apache.ignite.hibernate.region_cache.region1=cache1
| Constructor and Description |
|---|
HibernateRegionFactory() |
| Modifier and Type | Method and Description |
|---|---|
org.hibernate.cache.spi.DomainDataRegion |
buildDomainDataRegion(org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionCfg,
org.hibernate.cache.cfg.spi.DomainDataRegionBuildingContext buildingCtx) |
org.hibernate.cache.spi.QueryResultsRegion |
buildQueryResultsRegion(String regionName,
org.hibernate.engine.spi.SessionFactoryImplementor sessFactory) |
org.hibernate.cache.spi.TimestampsRegion |
buildTimestampsRegion(String regionName,
org.hibernate.engine.spi.SessionFactoryImplementor sessFactory) |
org.hibernate.cache.spi.access.AccessType |
getDefaultAccessType() |
boolean |
isMinimalPutsEnabledByDefault() |
long |
nextTimestamp() |
String |
qualify(String regionName) |
void |
start(org.hibernate.boot.spi.SessionFactoryOptions options,
Map cfgValues) |
void |
stop() |
public void start(org.hibernate.boot.spi.SessionFactoryOptions options,
Map cfgValues)
throws org.hibernate.cache.CacheException
start in interface org.hibernate.cache.spi.RegionFactoryorg.hibernate.cache.CacheExceptionpublic void stop()
stop in interface org.hibernate.service.spi.Stoppablepublic boolean isMinimalPutsEnabledByDefault()
isMinimalPutsEnabledByDefault in interface org.hibernate.cache.spi.RegionFactorypublic org.hibernate.cache.spi.access.AccessType getDefaultAccessType()
getDefaultAccessType in interface org.hibernate.cache.spi.RegionFactorypublic long nextTimestamp()
nextTimestamp in interface org.hibernate.cache.spi.RegionFactorypublic String qualify(String regionName)
qualify in interface org.hibernate.cache.spi.RegionFactorypublic org.hibernate.cache.spi.DomainDataRegion buildDomainDataRegion(org.hibernate.cache.cfg.spi.DomainDataRegionConfig regionCfg,
org.hibernate.cache.cfg.spi.DomainDataRegionBuildingContext buildingCtx)
buildDomainDataRegion in interface org.hibernate.cache.spi.RegionFactorypublic org.hibernate.cache.spi.QueryResultsRegion buildQueryResultsRegion(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessFactory)
buildQueryResultsRegion in interface org.hibernate.cache.spi.RegionFactorypublic org.hibernate.cache.spi.TimestampsRegion buildTimestampsRegion(String regionName, org.hibernate.engine.spi.SessionFactoryImplementor sessFactory)
buildTimestampsRegion in interface org.hibernate.cache.spi.RegionFactory
GridGain In-Memory Computing Platform : ver. 8.9.26 Release Date : October 16 2025