@Retention(value=RUNTIME) @Target(value=FIELD) public @interface Index
unique=false and primary=true will be ignored.
Only one index per class hierarchy may be marked as primary.
If index auto generation is turned on then classes containing @Index
will be used. Indexes will always be generated with the containing class's label and
the annotated property's name.
Index generation behaviour can be defined in ogm.properties by
defining a property called: indexes.auto and providing
a value of:
assert: drop all indexes and constraints then create
constraints and indexes on startup. No indexes or constraints will be dropped on
shutdown.validate: confirm that the required indexes and constraints
defined already exist on startup otherwise abort startupdump: will generate a file in the current directory with the
cypher commands to create indexes and constraints. Before doing this it will run the
same behaviour as validate.none: do not generate any constraints or indexes
[default]| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
primary
Indicates this constraint (unique index) should be used as the key for merges and loading by id.
|
boolean |
unique
Indicates whether to apply a unique constraint on this property, defaults to
false.
|
public abstract boolean unique
public abstract boolean primary
Copyright © 2017 Neo Technology, Inc.. All rights reserved.