The Index annotation is used in schema generation. Note that it is not necessary to specify an index
for a primary key, as the primary key index will be created automatically, however, the Index annotation
may be used to specify the ordering of the columns in the index for the primary key.
- Since:
- JPA 2.1
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescription(Required) The names of the columns to be included in the index. -
Optional Element Summary
Optional Elements
-
Element Details
-
columnList
String columnList(Required) The names of the columns to be included in the index.- Returns:
- The names of the columns making up the index
-
-
-
name
String name(Optional) The name of the index. Defaults to a provider-generated value.- Returns:
- The index name
- Default:
- ""
-
unique
boolean unique(Optional) Whether the index is unique. Default is false.- Returns:
- Is the index unique?
- Default:
- false
-