|
EclipseLink 1.2.0, build 'v20091016-r5565' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value=TYPE) @Retention(value=RUNTIME) public @interface Cache
The Cache annotation is used to configure the EclipseLink object cache. By default EclipseLink uses a shared object cache to cache all objects. The caching type and options can be configured on a per class basis to allow optimal caching.
This includes options for configuring the type of caching, setting the size, disabling the shared cache, expiring objects, refreshing, and cache coordination (clustering).
A Cache annotation may be defined on an Entity or MappedSuperclass. In the case of inheritance, a Cache annotation should only be defined on the root of the inheritance hierarchy.
CacheType
,
CacheCoordinationType
,
ClassDescriptor
,
CacheInvalidationPolicy
Optional Element Summary | |
---|---|
boolean |
alwaysRefresh
(Optional) Force all queries that go to the database to always refresh the cache. |
CacheCoordinationType |
coordinationType
(Optional) The cache coordination mode. |
boolean |
disableHits
(Optional) Setting to true will force all queries to bypass the cache for hits but still resolve against the cache for identity. |
int |
expiry
(Optional) Expire cached instance after a fix period of time (ms). |
TimeOfDay |
expiryTimeOfDay
(Optional) Expire cached instance a specific time of day. |
boolean |
refreshOnlyIfNewer
(Optional) For all queries that go to the database, refresh the cache only if the data received from the database by a query is newer than the data in the cache (as determined by the optimistic locking field). |
boolean |
shared
(Optional) Cached instances in the shared cache, or only a per EntityManager isolated cache. |
int |
size
(Optional) The size of cache to use. |
CacheType |
type
(Optional) The type of cache to use. |
public abstract CacheType type
public abstract int size
public abstract boolean shared
public abstract int expiry
public abstract TimeOfDay expiryTimeOfDay
public abstract boolean alwaysRefresh
public abstract boolean refreshOnlyIfNewer
public abstract boolean disableHits
public abstract CacheCoordinationType coordinationType
|
EclipseLink 1.2.0, build 'v20091016-r5565' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |