public class CacheUsage
extends java.lang.Object
JPA Query Hint Usage:
query.setHint(QueryHints.CACHE_USAGE, CacheUsage.CheckCacheOnly);
or
@QueryHint(name=QueryHints.CACHE_USAGE, value=CacheUsage.CheckCacheOnly)
Hint values are case-insensitive. "" could be used instead of default value CacheUsage.DEFAULT.
QueryHints
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CheckCacheByExactPrimaryKey
Configure the cache to be checked first if the query is by primary key (only).
|
static java.lang.String |
CheckCacheByPrimaryKey
Configure the cache to be checked first if the query contains the primary key.
|
static java.lang.String |
CheckCacheOnly
Configure the cache to be searched for any matching objects.
|
static java.lang.String |
CheckCacheThenDatabase
Configure the cache to be searched for any matching object before accesing the database.
|
static java.lang.String |
ConformResultsInUnitOfWork
Configure the query results to be conformed with the current persistence context.
|
static java.lang.String |
DEFAULT |
static java.lang.String |
DoNotCheckCache
Do not check the cache first, this is the default for JPA Queries.
|
static java.lang.String |
Invalidate
Configures a modify-all query to invalidate the cache.
|
static java.lang.String |
NoCache
Configures a modify-all query to not invalidate the cache.
|
static java.lang.String |
UseEntityDefault
By default the descriptor default is used, which is to not check the cache first.
|
Constructor and Description |
---|
CacheUsage() |
public static final java.lang.String UseEntityDefault
public static final java.lang.String DoNotCheckCache
public static final java.lang.String CheckCacheByExactPrimaryKey
public static final java.lang.String CheckCacheByPrimaryKey
public static final java.lang.String CheckCacheThenDatabase
public static final java.lang.String CheckCacheOnly
public static final java.lang.String ConformResultsInUnitOfWork
public static final java.lang.String NoCache
public static final java.lang.String Invalidate
public static final java.lang.String DEFAULT