Interface CacheSettings
- All Known Subinterfaces:
AvailableSettings
- All Known Implementing Classes:
Environment
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringDeprecated.static final StringTheRegionFactoryimplementation, either: an instance ofRegionFactory, aClassimplementingRegionFactory, or the name of a class implementingRegionFactory.static final StringTheCacheProviderregion name prefixstatic final StringEntity cache configuration properties follow the patternhibernate.classcache.packagename.ClassName usage[, region]whereusageis the cache strategy used andregionthe cache region namestatic final StringCollection cache configuration properties follow the patternhibernate.collectioncache.packagename.ClassName.role usage[, region]whereusageis the cache strategy used andregionthe cache region namestatic final StringSpecifies theCacheConcurrencyStrategyto use by default when an entity is marked@Cacheable, but no concurrency strategy is explicitly specified via theCacheannotation.static final StringWhen 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 final StringSet a default value forSpecHints.HINT_SPEC_CACHE_RETRIEVE_MODE, used when the hint is not explicitly specified.static final StringSet a default value forSpecHints.HINT_SPEC_CACHE_STORE_MODE, used when the hint is not explicitly specified.static final StringDeprecated.UseJAKARTA_SHARED_CACHE_MODEinsteadstatic final StringDeprecated.UseJAKARTA_SHARED_CACHE_RETRIEVE_MODEinsteadstatic final StringDeprecated.UseJAKARTA_SHARED_CACHE_STORE_MODEinsteadstatic final StringSpecifies theTimestampsCacheFactoryto use.static final StringSpecifies the defaultCacheLayoutto use for the query cache.static final StringEnable direct storage of entity references into the second level cache when applicable.static final StringOptimize interaction with the second-level cache to minimize writes, at the cost of an additional read before each write.static final StringEnable the query results cachestatic final StringWhen enabled, specifies that the second-level cache may be used.static final StringEnables the use of structured second-level cache entries.
-
Field Details
-
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:
-
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
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
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:
- Default Value:
truewhen a provider is specified;falseotherwise.
-
USE_QUERY_CACHE
Enable the query results cache- See Also:
- Default Value:
false
-
QUERY_CACHE_LAYOUT
Specifies the defaultCacheLayoutto use for the query cache. -
CACHE_REGION_FACTORY
TheRegionFactoryimplementation, either:- an instance of
RegionFactory, - a
ClassimplementingRegionFactory, or - the name of a class implementing
RegionFactory.
Defaults to
NoCachingRegionFactory, so that caching is disabled.- See Also:
- an instance of
-
QUERY_CACHE_FACTORY
Specifies theTimestampsCacheFactoryto use. -
CACHE_REGION_PREFIX
TheCacheProviderregion name prefix -
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:
- Default Value:
- The cache provider's default strategy
-
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:
- Default Value:
- The cache provider's default
-
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:
- Default Value:
false
-
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:
- Default Value:
false
-
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:
- Default Value:
false
-
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:
- an instance of
-
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:
-
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:
-
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:
-
JPA_SHARED_CACHE_RETRIEVE_MODE
Deprecated.UseJAKARTA_SHARED_CACHE_RETRIEVE_MODEinstead- See Also:
-
JPA_SHARED_CACHE_STORE_MODE
Deprecated.UseJAKARTA_SHARED_CACHE_STORE_MODEinstead- See Also:
-
hibernate-infinispan