Top Description Methods
org.eclipse.persistence.annotations

public @Interface CacheIndex

extends Annotation
Annotations
@Target:METHOD, FIELD, TYPE
@Retention:RUNTIME
@Repeatable:CacheIndexes
Imports
java.lang.annotation.Retention, .Target, .Repeatable

Allow a cache index to be define. A cache index allow singleResult queries to obtain a cache hit when querying on the indexed fields. resultList queries cannot obtain cache hits, as it is unknown if all of the objects are in memory, (unless the cache usage query hint is used). The index should be unique, but if not unique, the first indexed object will be returned. Cache indexes are only relevant when caching is enabled. The @CacheIndex can be defined on a Entity class, or on an attribute. The column is defaulted when defined on a attribute.
Author
James Sutherland
Since
EclipseLink 2.4

Method Summary

Modifier and TypeMethod and Description
public String[]
columnNames()

Specify the set of columns to define the index on.

public boolean
updateable()

Specify if the indexed field is updateable.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

columnNamesback to summary
public String[] columnNames()

Specify the set of columns to define the index on. Not required when annotated on a field/method.

updateableback to summary
public boolean updateable()

Specify if the indexed field is updateable. If updateable the object will be re-indexed on each update/refresh.