Annotation Interface Index
Used in schema generation to specify creation of an index.
The syntax of the columnList element depends on
the SQL dialect, but is usually a comma-separated list of
column names, with an optional ordering specification,
ASC or DESC.
Note that it is not necessary to specify an index for a primary key, as the primary key has a unique constraint with an index created automatically.
- Since:
- 2.1
- See Also:
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescription(Required) The columns included in the index, in order, following the BNF rulecolumn_listgiven above. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescription(Optional) The name of the index.(Optional) A SQL fragment appended to the generated DDL which creates this index.(Optional) A SQL fragment indicating the type of index, usually inserted before the keywordindexin the generated DDL which creates this index.boolean(Optional) Whether the index is unique.(Optional) A SQL fragment representing the indexing method.
-
Element Details
-
name
-
columnList
String columnList(Required) The columns included in the index, in order, following the BNF rulecolumn_listgiven above. -
unique
boolean unique(Optional) Whether the index is unique.- Default:
false
-
type
String type(Optional) A SQL fragment indicating the type of index, usually inserted before the keywordindexin the generated DDL which creates this index.For example,
type = "UNIQUE"results inCREATE UNIQUE INDEX ....- Since:
- 4.0
- Default:
""
-
using
String using(Optional) A SQL fragment representing the indexing method. When specified, it is inserted into the generated DDL which creates this index, usually following aUSINGkeyword.For example,
using = "BTREE"results inCREATE INDEX ... USING BTREE ....- Since:
- 4.0
- Default:
""
-
options
String options(Optional) A SQL fragment appended to the generated DDL which creates this index.For example,
options = "INCLUDE (total)"results inCREATE INDEX ... INCLUDE (total).- Since:
- 3.2
- Default:
""
-