public class HibernateEntityRegion extends HibernateTransactionalDataRegion
EntityRegion
. This region is used to store entity data.
L2 cache for entity can be enabled in the Hibernate configuration file:
<hibernate-configuration> <!-- Enable L2 cache. --> <property name="cache.use_second_level_cache">true</property> <!-- Use Ignite as L2 cache provider. --> <property name="cache.region.factory_class">org.apache.ignite.cache.hibernate.HibernateRegionFactory</property> <!-- Specify entity. --> <mapping class="com.example.Entity"/> <!-- Enable L2 cache with nonstrict-read-write access strategy for entity. --> <class-cache class="com.example.Entity" usage="nonstrict-read-write"/> </hibernate-configuration>Also cache for entity can be enabled using annotations:
@javax.persistence.Entity @javax.persistence.Cacheable @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Entity { ... }
cache, ignite
Constructor and Description |
---|
HibernateEntityRegion(HibernateRegionFactory factory,
String name,
Ignite ignite,
HibernateCacheProxy cache,
CacheDataDescription dataDesc) |
Modifier and Type | Method and Description |
---|---|
EntityRegionAccessStrategy |
buildAccessStrategy(org.hibernate.cache.spi.access.AccessType accessType) |
getCacheDataDescription, isTransactionAware
clear, destroy, getElementCountInMemory, getElementCountOnDisk, getSizeInMemory
public HibernateEntityRegion(HibernateRegionFactory factory, String name, Ignite ignite, HibernateCacheProxy cache, CacheDataDescription dataDesc)
factory
- Region factory.name
- Region name.ignite
- Grid.cache
- Region cache,dataDesc
- Region data description.
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024