@Retention(value=CLASS)
@Target(value=FIELD)
public @interface Unique
Trying to put an object with offending values will result in a UniqueViolationException (see ConflictStrategy.FAIL).
Set onConflict() to change this strategy.
Note: Unique properties are based on an @Index, so the same restrictions apply.
It is supported to explicitly add the @Index annotation to configure the index.
| Modifier and Type | Optional Element and Description |
|---|---|
ConflictStrategy |
onConflict
The strategy to use when a conflict is detected when an object is put.
|
public abstract ConflictStrategy onConflict