Top Description Fields Constructors Methods
jakarta.persistence

public final Enum SharedCacheMode

extends Enum<SharedCacheMode>
Class Inheritance
Imports
jakarta.persistence.spi.PersistenceUnitInfo

Specifies how the provider must use a second-level cache for the persistence unit. Corresponds to the value of the persistence.xml shared-cache-mode element, and returned as the result of PersistenceUnitInfo#getSharedCacheMode().
Since
2.0

Field Summary

Modifier and TypeField and Description
public static final SharedCacheMode
ALL

All entities and entity-related state and data are cached.

public static final SharedCacheMode
DISABLE_SELECTIVE

Caching is enabled for all entities except those for which Cacheable(false) is specified.

public static final SharedCacheMode
ENABLE_SELECTIVE

Caching is enabled for all entities for which Cacheable(true) is specified.

public static final SharedCacheMode
NONE

Caching is disabled for the persistence unit.

public static final SharedCacheMode
UNSPECIFIED

Caching behavior is undefined: provider-specific defaults may apply.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static SharedCacheMode
public static SharedCacheMode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALLback to summary
public static final SharedCacheMode ALL

All entities and entity-related state and data are cached.

DISABLE_SELECTIVEback to summary
public static final SharedCacheMode DISABLE_SELECTIVE

Caching is enabled for all entities except those for which Cacheable(false) is specified. Entities for which Cacheable(false) is specified are not cached.

ENABLE_SELECTIVEback to summary
public static final SharedCacheMode ENABLE_SELECTIVE

Caching is enabled for all entities for which Cacheable(true) is specified. All other entities are not cached.

NONEback to summary
public static final SharedCacheMode NONE

Caching is disabled for the persistence unit.

UNSPECIFIEDback to summary
public static final SharedCacheMode UNSPECIFIED

Caching behavior is undefined: provider-specific defaults may apply.

Constructor Detail

SharedCacheModeback to summary
private SharedCacheMode()

Method Detail

valueOfback to summary
public static SharedCacheMode valueOf(String name)
valuesback to summary
public static SharedCacheMode[] values()