Package io.ebean.annotation
Annotation Type Index
-
@Target({TYPE,FIELD}) @Retention(RUNTIME) @Repeatable(Indices.class) public @interface Index
An annotation for declaring an index.- Author:
- rvbiljouw
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description String[]columnNamesWhen placed on the class (rather than field) you can specify the columns to include in the index in order.booleanconcurrentIf set true with Postgres this index should be created concurrently.StringdefinitionThe full raw SQL definition to create the index.StringnameName of the index.Platform[]platformsPlatforms this index applies to - default is all platforms.booleanuniqueIf set true indicates this is a unique index.
-
-
-
-
unique
boolean unique
If set true indicates this is a unique index.- Default:
- false
-
-
-
concurrent
boolean concurrent
If set true with Postgres this index should be created concurrently.This attribute currently only applies to Postgres applying to both the
create indexanddrop indexgenerated DDL.- Default:
- false
-
-
-
columnNames
String[] columnNames
When placed on the class (rather than field) you can specify the columns to include in the index in order.When placed on a field, and columnNames are specified, the field-column has to be included. You can use "${fa}" for alias.
- Default:
- {}
-
-
-
platforms
Platform[] platforms
Platforms this index applies to - default is all platforms.This provides an alternative to using extra-dll.xml to specify platform specific index ddl.
Changing platforms is NOT detected as part of DB migration generation (no platform specific DIFF) so using extra-ddl.xml may be preferred.
- Default:
- {}
-
-
-
definition
String definition
The full raw SQL definition to create the index.The indexName should be provided such that the drop index statement can be generated as needed.
This allows for platform specific index creation features as an alternative to using ebean extra-dll.xml to define extra potentially platform specific DDL.
{@code- Default:
- ""
-
-