|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.config.CacheUsage
public class CacheUsage
Cache usage hint values. Cache usage allows the cache to be used on queries to avoid accessing the database. By default for JPA queries the cache is not checked before accessing the database, but is used after accessing the database to avoid re-building the objects and avoid accessing the database for relationships. Cache usage can also be used for modify Update-All and Delete-All queries. For modify-all queries it effects how the cache is updated, either NoCache or Invalidate. By default modify-all queries invalidate the cache. The class contains all the valid values for QueryHints.CACHE_USAGE query hint.
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
Field Summary | |
---|---|
static String |
CheckCacheByExactPrimaryKey
Configure the cache to be checked first if the query is by primary key (only). |
static String |
CheckCacheByPrimaryKey
Configure the cache to be checked first if the query contains the primary key. |
static String |
CheckCacheOnly
Configure the cache to be searched for any matching objects. |
static String |
CheckCacheThenDatabase
Configure the cache to be searched for any matching object before accesing the database. |
static String |
ConformResultsInUnitOfWork
Configure the query results to be conformed with the current persistence context. |
static String |
DEFAULT
|
static String |
DoNotCheckCache
Do not check the cache first, this is the default for JPA Queries. |
static String |
Invalidate
Configures a modify-all query to invalidate the cache. |
static String |
NoCache
Configures a modify-all query to not invalidate the cache. |
static String |
UseEntityDefault
By default the descriptor default is used, which is to not check the cache first. |
Constructor Summary | |
---|---|
CacheUsage()
|
Method Summary |
---|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String UseEntityDefault
public static final String DoNotCheckCache
public static final String CheckCacheByExactPrimaryKey
public static final String CheckCacheByPrimaryKey
public static final String CheckCacheThenDatabase
public static final String CheckCacheOnly
public static final String ConformResultsInUnitOfWork
public static final String NoCache
public static final String Invalidate
public static final String DEFAULT
Constructor Detail |
---|
public CacheUsage()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |