javax.persistence

## Annotation Type Index

-     @Target(value={})
      @Retention(value=RUNTIME)
      public @interface Index

  Used in schema generation to specify creation of an index.

  Note that it is not necessary to specify an index for a primary key, as the primary key index will be created automatically.

  The syntax of the `columnList` element is a `column_list`, as follows:

          column::= index_column [,index_column]*
          index_column::= column_name [ASC | DESC]

  If `ASC` or `DESC` is not specified, `ASC` (ascending order) is assumed.

  Since:
    Java Persistence 2.1
  See Also:
    `Table`, `SecondaryTable`, `CollectionTable`, `JoinTable`, `TableGenerator`

- - ### Required Element Summary

    Required Elements
    Modifier and Type | Required Element and Description
    --- | ---
    `String` | `columnList` (Required) The names of the columns to be included in the index, in order.

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `String` | `name` (Optional) The name of the index; defaults to a provider-generated name.
    `boolean` | `unique` (Optional) Whether the index is unique.

- - ### Element Detail

    - #### columnList

          public abstract String columnList

      (Required) The names of the columns to be included in the index, in order.

    - #### name

          public abstract String name

      (Optional) The name of the index; defaults to a provider-generated name.
      Default:
        ""

    - #### unique

          public abstract boolean unique

      (Optional) Whether the index is unique.
      Default:
        false

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.