@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface Cache
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
Modifier and Type | Optional Element and Description |
---|---|
boolean |
alwaysRefresh
(Optional) Force all queries that go to the database to always
refresh the cache.
|
CacheCoordinationType |
coordinationType
(Optional) The cache coordination mode.
|
DatabaseChangeNotificationType |
databaseChangeNotificationType
(Optional) The database change notification 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.
|
CacheIsolationType |
isolation
(Optional) Controls the level of caching this Entity will use.
|
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
Deprecated.
As of Eclipselink 2.2. See the attribute 'isolation'
|
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
@Deprecated public abstract boolean shared
public abstract CacheIsolationType isolation
CacheIsolationType
public abstract int expiry
public abstract TimeOfDay expiryTimeOfDay
public abstract boolean alwaysRefresh
public abstract boolean refreshOnlyIfNewer
public abstract boolean disableHits
public abstract CacheCoordinationType coordinationType
public abstract DatabaseChangeNotificationType databaseChangeNotificationType