Interface CacheSettings
-
public interface CacheSettingsSettings for Hibernate's second-level caching
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTO_EVICT_COLLECTION_CACHEstatic StringCACHE_KEYS_FACTORYDeprecated.this is only honored forhibernate-infinispanstatic StringCACHE_REGION_FACTORYTheRegionFactoryimplementation, either: an instance ofRegionFactory, aClassimplementingRegionFactory, or he name of a class implementingRegionFactory.static StringCACHE_REGION_PREFIXTheCacheProviderregion name prefixstatic StringCLASS_CACHE_PREFIXEntity cache configuration properties follow the patternhibernate.classcache.packagename.ClassName usage[, region]whereusageis the cache strategy used andregionthe cache region namestatic StringCOLLECTION_CACHE_PREFIXCollection cache configuration properties follow the patternhibernate.collectioncache.packagename.ClassName.role usage[, region]whereusageis the cache strategy used andregionthe cache region namestatic StringDEFAULT_CACHE_CONCURRENCY_STRATEGYSpecifies theCacheConcurrencyStrategyto use by default when an entity is marked@Cacheable, but no concurrency strategy is explicitly specified via theCacheannotation.static StringJAKARTA_SHARED_CACHE_MODEWhen enabled, specifies that the second-level cache (which JPA calls the "shared" cache) may be used, as per the rules defined in JPA 2 section 3.1.7.static StringJAKARTA_SHARED_CACHE_RETRIEVE_MODESet a default value forSpecHints.HINT_SPEC_CACHE_RETRIEVE_MODE, used when the hint is not explicitly specified.static StringJAKARTA_SHARED_CACHE_STORE_MODESet a default value forSpecHints.HINT_SPEC_CACHE_STORE_MODE, used when the hint is not explicitly specified.static StringJPA_SHARED_CACHE_MODEDeprecated.UseJAKARTA_SHARED_CACHE_MODEinsteadstatic StringJPA_SHARED_CACHE_RETRIEVE_MODEDeprecated.UseJAKARTA_SHARED_CACHE_RETRIEVE_MODEinsteadstatic StringJPA_SHARED_CACHE_STORE_MODEDeprecated.UseJAKARTA_SHARED_CACHE_STORE_MODEinsteadstatic StringQUERY_CACHE_FACTORYSpecifies theTimestampsCacheFactoryto use.static StringUSE_DIRECT_REFERENCE_CACHE_ENTRIESEnable direct storage of entity references into the second level cache when applicable.static StringUSE_MINIMAL_PUTSOptimize interaction with the second-level cache to minimize writes, at the cost of an additional read before each write.static StringUSE_QUERY_CACHEEnable the query results cachestatic StringUSE_SECOND_LEVEL_CACHEWhen enabled, specifies that the second-level cache may be used.static StringUSE_STRUCTURED_CACHEEnables the use of structured second-level cache entries.
-
-
-
Field Detail
-
JAKARTA_SHARED_CACHE_MODE
static final String JAKARTA_SHARED_CACHE_MODE
When enabled, specifies that the second-level cache (which JPA calls the "shared" cache) may be used, as per the rules defined in JPA 2 section 3.1.7.See JPA 2 sections 9.4.3 and 8.2.1.7
- See Also:
SharedCacheMode, Constant Field Values
-
JAKARTA_SHARED_CACHE_RETRIEVE_MODE
static final String JAKARTA_SHARED_CACHE_RETRIEVE_MODE
Set a default value forSpecHints.HINT_SPEC_CACHE_RETRIEVE_MODE, used when the hint is not explicitly specified.It does not usually make sense to change the default from
CacheRetrieveMode.USE.
-
JAKARTA_SHARED_CACHE_STORE_MODE
static final String JAKARTA_SHARED_CACHE_STORE_MODE
Set a default value forSpecHints.HINT_SPEC_CACHE_STORE_MODE, used when the hint is not explicitly specified.It does not usually make sense to change the default from
CacheStoreMode.USE.
-
USE_SECOND_LEVEL_CACHE
static final String USE_SECOND_LEVEL_CACHE
When enabled, specifies that the second-level cache may be used.By default, if the configured
RegionFactoryis not theNoCachingRegionFactory, then the second-level cache is enabled. Otherwise, the second-level cache is disabled.- See Also:
CACHE_REGION_FACTORY,SessionFactoryBuilder.applySecondLevelCacheSupport(boolean), Constant Field Values- Default Value:
truewhen a provider is specified;falseotherwise.
-
USE_QUERY_CACHE
static final String USE_QUERY_CACHE
Enable the query results cache- See Also:
SessionFactoryBuilder.applyQueryCacheSupport(boolean), Constant Field Values- Default Value:
false
-
CACHE_REGION_FACTORY
static final String CACHE_REGION_FACTORY
TheRegionFactoryimplementation, either:- an instance of
RegionFactory, - a
ClassimplementingRegionFactory, or - he name of a class implementing
RegionFactory.
Defaults to
NoCachingRegionFactory, so that caching is disabled.- See Also:
USE_SECOND_LEVEL_CACHE, Constant Field Values
- an instance of
-
QUERY_CACHE_FACTORY
static final String QUERY_CACHE_FACTORY
Specifies theTimestampsCacheFactoryto use.
-
CACHE_REGION_PREFIX
static final String CACHE_REGION_PREFIX
TheCacheProviderregion name prefix
-
DEFAULT_CACHE_CONCURRENCY_STRATEGY
static final String DEFAULT_CACHE_CONCURRENCY_STRATEGY
Specifies theCacheConcurrencyStrategyto use by default when an entity is marked@Cacheable, but no concurrency strategy is explicitly specified via theCacheannotation.An explicit strategy may be specified using
@Cache(usage=...).- See Also:
MetadataBuilder.applyAccessType(org.hibernate.cache.spi.access.AccessType),RegionFactory.getDefaultAccessType(), Constant Field Values- Default Value:
- The cache provider's default strategy
-
USE_MINIMAL_PUTS
static final String USE_MINIMAL_PUTS
Optimize interaction with the second-level cache to minimize writes, at the cost of an additional read before each write. This setting is useful if writes to the cache are much more expensive than reads from the cache, for example, if the cache is a distributed cache.It's not usually necessary to set this explicitly because, by default, it's set to a sensible value by the second-level cache implementation.
- See Also:
SessionFactoryBuilder.applyMinimalPutsForCaching(boolean),RegionFactory.isMinimalPutsEnabledByDefault(), Constant Field Values- Default Value:
- The cache provider's default
-
USE_STRUCTURED_CACHE
static final String USE_STRUCTURED_CACHE
Enables the use of structured second-level cache entries. This makes the cache entries human-readable, but carries a performance cost.- See Also:
SessionFactoryBuilder.applyStructuredCacheEntries(boolean), Constant Field Values- Default Value:
false
-
AUTO_EVICT_COLLECTION_CACHE
static final String AUTO_EVICT_COLLECTION_CACHE
Enables the automatic eviction of a bidirectional association's collection cache when an element in theManyToOnecollection is added, updated, or removed without properly managing the change on theOneToManyside.- See Also:
SessionFactoryBuilder.applyAutomaticEvictionOfCollectionCaches(boolean), Constant Field Values- Default Value:
false
-
USE_DIRECT_REFERENCE_CACHE_ENTRIES
static final String USE_DIRECT_REFERENCE_CACHE_ENTRIES
Enable direct storage of entity references into the second level cache when applicable. This is appropriate only for immutable entities.By default, entities are always stored in a "disassembled" form, that is, as a tuple of attribute values.
- See Also:
SessionFactoryBuilder.applyDirectReferenceCaching(boolean), Constant Field Values- Default Value:
false
-
CACHE_KEYS_FACTORY
@Deprecated static final String CACHE_KEYS_FACTORY
Deprecated.this is only honored forhibernate-infinispanSpecifies theCacheKeysFactoryto use, either:- an instance of
CacheKeysFactory, - a
ClassimplementingCacheKeysFactory, - the name of a class implementing
CacheKeysFactory, "default"as a short name forDefaultCacheKeysFactory, or"simple"as a short name forSimpleCacheKeysFactory.
- Since:
- 5.2
- See Also:
- Constant Field Values
- an instance of
-
CLASS_CACHE_PREFIX
static final String CLASS_CACHE_PREFIX
Entity cache configuration properties follow the patternhibernate.classcache.packagename.ClassName usage[, region]whereusageis the cache strategy used andregionthe cache region name- See Also:
- Constant Field Values
-
COLLECTION_CACHE_PREFIX
static final String COLLECTION_CACHE_PREFIX
Collection cache configuration properties follow the patternhibernate.collectioncache.packagename.ClassName.role usage[, region]whereusageis the cache strategy used andregionthe cache region name- See Also:
- Constant Field Values
-
JPA_SHARED_CACHE_MODE
@Deprecated static final String JPA_SHARED_CACHE_MODE
Deprecated.UseJAKARTA_SHARED_CACHE_MODEinsteadUsed to indicate whether second-level (what JPA terms shared cache) caching is enabled as per the rules defined in JPA 2 section 3.1.7.See JPA 2 sections 9.4.3 and 8.2.1.7
- See Also:
SharedCacheMode, Constant Field Values
-
JPA_SHARED_CACHE_RETRIEVE_MODE
@Deprecated static final String JPA_SHARED_CACHE_RETRIEVE_MODE
Deprecated.UseJAKARTA_SHARED_CACHE_RETRIEVE_MODEinstead- See Also:
- Constant Field Values
-
JPA_SHARED_CACHE_STORE_MODE
@Deprecated static final String JPA_SHARED_CACHE_STORE_MODE
Deprecated.UseJAKARTA_SHARED_CACHE_STORE_MODEinstead- See Also:
- Constant Field Values
-
-