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.
EntityManager#setCacheStoreMode(CacheStoreMode), Query#setCacheStoreMode(CacheStoreMode)
| Modifier and Type | Field and Description |
|---|---|
| public static final CacheStoreMode | BYPASS
Don't insert into cache. |
| public static final CacheStoreMode | REFRESH
Insert/update entity data held in the cache when read from the database and when written to the database. |
| public static final CacheStoreMode | USE
Insert entity data into cache when read from database and insert/update entity data when written to the database: this is the default behavior. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static CacheStoreMode | |
| public static CacheStoreMode[] |
| BYPASS | back to summary |
|---|---|
| public static final CacheStoreMode BYPASS Don't insert into cache. | |
| REFRESH | back to summary |
|---|---|
| public static final CacheStoreMode REFRESH 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. | |
| USE | back to summary |
|---|---|
| public static final CacheStoreMode USE 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. | |
| CacheStoreMode | back to summary |
|---|---|
| private CacheStoreMode() | |
| valueOf | back to summary |
|---|---|
| public static CacheStoreMode valueOf(String name) | |
| values | back to summary |
|---|---|
| public static CacheStoreMode[] values() | |