Interface CacheSettings
- All Known Subinterfaces:
AvailableSettings
- All Known Implementing Classes:
Environment
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
Deprecated.static final String
TheRegionFactory
implementation, either: an instance ofRegionFactory
, aClass
implementingRegionFactory
, or the name of a class implementingRegionFactory
.static final String
TheCacheProvider
region name prefixstatic final String
Entity cache configuration properties follow the patternhibernate.classcache.packagename.ClassName usage[, region]
whereusage
is the cache strategy used andregion
the cache region namestatic final String
Collection cache configuration properties follow the patternhibernate.collectioncache.packagename.ClassName.role usage[, region]
whereusage
is the cache strategy used andregion
the cache region namestatic final String
Specifies theCacheConcurrencyStrategy
to use by default when an entity is marked@Cacheable
, but no concurrency strategy is explicitly specified via theCache
annotation.static final String
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.static final String
Set a default value forSpecHints.HINT_SPEC_CACHE_RETRIEVE_MODE
, used when the hint is not explicitly specified.static final String
Set a default value forSpecHints.HINT_SPEC_CACHE_STORE_MODE
, used when the hint is not explicitly specified.static final String
Deprecated.UseJAKARTA_SHARED_CACHE_MODE
insteadstatic final String
Deprecated.UseJAKARTA_SHARED_CACHE_RETRIEVE_MODE
insteadstatic final String
Deprecated.UseJAKARTA_SHARED_CACHE_STORE_MODE
insteadstatic final String
Specifies theTimestampsCacheFactory
to use.static final String
Specifies the defaultCacheLayout
to use for the query cache.static final String
Enable direct storage of entity references into the second level cache when applicable.static final String
Optimize interaction with the second-level cache to minimize writes, at the cost of an additional read before each write.static final String
Enable the query results cachestatic final String
When enabled, specifies that the second-level cache may be used.static final String
Enables 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
RegionFactory
is not theNoCachingRegionFactory
, then the second-level cache is enabled. Otherwise, the second-level cache is disabled.- See Also:
- Default Value:
true
when a provider is specified;false
otherwise.
-
USE_QUERY_CACHE
Enable the query results cache- See Also:
- Default Value:
false
-
QUERY_CACHE_LAYOUT
Specifies the defaultCacheLayout
to use for the query cache. -
CACHE_REGION_FACTORY
TheRegionFactory
implementation, either:- an instance of
RegionFactory
, - a
Class
implementingRegionFactory
, 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 theTimestampsCacheFactory
to use. -
CACHE_REGION_PREFIX
TheCacheProvider
region name prefix -
DEFAULT_CACHE_CONCURRENCY_STRATEGY
Specifies theCacheConcurrencyStrategy
to use by default when an entity is marked@Cacheable
, but no concurrency strategy is explicitly specified via theCache
annotation.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 theManyToOne
collection is added, updated, or removed without properly managing the change on theOneToMany
side.- 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-infinispan
Specifies theCacheKeysFactory
to use, either:- an instance of
CacheKeysFactory
, - a
Class
implementingCacheKeysFactory
, - 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]
whereusage
is the cache strategy used andregion
the cache region name- See Also:
-
COLLECTION_CACHE_PREFIX
Collection cache configuration properties follow the patternhibernate.collectioncache.packagename.ClassName.role usage[, region]
whereusage
is the cache strategy used andregion
the cache region name- See Also:
-
JPA_SHARED_CACHE_MODE
Deprecated.UseJAKARTA_SHARED_CACHE_MODE
insteadUsed 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_MODE
instead- See Also:
-
JPA_SHARED_CACHE_STORE_MODE
Deprecated.UseJAKARTA_SHARED_CACHE_STORE_MODE
instead- See Also:
-
hibernate-infinispan