EntityManager interacts with the
second-level cache when data is read from the database via
the EntityManager#find methods and execution of
queries.
USE indicates that data may be read from the
second-level cache.
BYPASS indicates that data may not be read
from the second-level cache.
Enumerates legal values of the property
jakarta.persistence.cache.retrieveMode.
EntityManager#setCacheRetrieveMode(CacheRetrieveMode), Query#setCacheRetrieveMode(CacheRetrieveMode)
| Modifier and Type | Field and Description |
|---|---|
| public static final CacheRetrieveMode | BYPASS
Bypass the cache: get data directly from the database. |
| public static final CacheRetrieveMode | USE
Read entity data from the cache: this is the default behavior. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static CacheRetrieveMode | |
| public static CacheRetrieveMode[] |
| BYPASS | back to summary |
|---|---|
| public static final CacheRetrieveMode BYPASS Bypass the cache: get data directly from the database. | |
| USE | back to summary |
|---|---|
| public static final CacheRetrieveMode USE Read entity data from the cache: this is the default behavior. | |
| CacheRetrieveMode | back to summary |
|---|---|
| private CacheRetrieveMode() | |
| valueOf | back to summary |
|---|---|
| public static CacheRetrieveMode valueOf(String name) | |
| values | back to summary |
|---|---|
| public static CacheRetrieveMode[] values() | |