@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface KVIndex
Types are required to have a natural index that uniquely identifies instances in the store. The default value of the annotation identifies the natural index for the type.
Indexes allow for more efficient sorting of data read from the store. By annotating a field or "getter" method with this annotation, an index will be created that will provide sorting based on the string value of that field.
Note that creating indices means more space will be needed, and maintenance operations like updating or deleting a value will become more expensive.
Indices are restricted to String, integral types (byte, short, int, long, boolean), and arrays of those values.
Modifier and Type | Fields and Description |
---|---|
static String |
NATURAL_INDEX_NAME |
Modifier and Type | Optional Element and Description |
---|---|
boolean |
copy
Whether to copy the instance's data to the index, instead of just storing a pointer to the
data.
|
String |
parent
The name of the parent index of this index.
|
String |
value
The name of the index to be created for the annotated entity.
|
public abstract String value
public abstract String parent
If a parent index is defined, iterating over the data using the index will require providing a single value for the parent index. This serves as a rudimentary way to provide relationships between entities in the store.