Jakarta Persistence (JPA) Enum

jakarta.persistence.CacheStoreMode

java.lang.Object
  java.lang.Enum<jakarta.persistence.CacheStoreMode>
    jakarta.persistence.CacheStoreMode
Implemented Interfaces:
FindOption, RefreshOption, Constable, Comparable<E>, Serializable

Specifies how the EntityManager interacts with the second-level cache when data is read from the database and when data is written to the database.
  • USE indicates that data may be written to the second-level cache.
  • BYPASS indicates that data may not be written to the second-level cache.
  • REFRESH indicates that data must be written to the second-level cache, even when the data is already cached.

Enumerates legal values of the property jakarta.persistence.cache.storeMode.

See Also:
Since:
Jakarta Persistence (JPA) 2.0
The JPA Shared (L2) Entity Cache article explains how to use CacheStoreMode.

Enum Constants

Don't insert into cache.
Since:
Jakarta Persistence (JPA) 1.0
Insert/update entity data held in the cache when read from the database and when written to the database.
Force refresh of cache for items read from database.
Since:
Jakarta Persistence (JPA) 1.0
Insert entity data into cache when read from database and insert/update entity data when written to the database: this is the default behavior.
Does not force refresh of already cached items when reading from database.
Since:
Jakarta Persistence (JPA) 1.0

Synthetic Public Static Methods:

values(), valueOf(String)

Additional JDK methods inherited from java.lang.Enum

java.lang.Enum/clone(), java.lang.Enum/compareTo(E), java.lang.Enum/describeConstable(), java.lang.Enum/equals(Object), java.lang.Enum/finalize(), java.lang.Enum/getDeclaringClass(), java.lang.Enum/hashCode(), java.lang.Enum/name(), java.lang.Enum/ordinal(), java.lang.Enum/readObject(ObjectInputStream), java.lang.Enum/readObjectNoData(), java.lang.Enum/toString(), java.lang.Enum/valueOf(Class,String)

Additional JDK methods inherited from java.lang.Object

java.lang.Object/clone(), java.lang.Object/equals(Object), java.lang.Object/finalize(), java.lang.Object/getClass(), java.lang.Object/hashCode(), java.lang.Object/notify(), java.lang.Object/notifyAll(), java.lang.Object/toString(), java.lang.Object/wait(), java.lang.Object/wait(long), java.lang.Object/wait(long,int), java.lang.Object/wait0(long)

Additional JDK methods inherited from java.lang.constant.Constable

java.lang.constant.Constable/describeConstable()

Additional JDK methods inherited from java.lang.Comparable

java.lang.Comparable/compareTo(T)