Annotation Type Index


  • @Target({})
    @Retention(RUNTIME)
    public @interface Index
    Used in schema generation to specify creation of an index.

    The syntax of the columnList element is given by the following simple BNF:

    If neither ASC nor DESC is not specified, ASC, that is, ascending order, is assumed.

    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:
    Table, SecondaryTable, CollectionTable, JoinTable, TableGenerator
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String columnList
      (Required) The columns included in the index, in order, following the BNF rule column_list given above.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String name
      (Optional) The name of the index.
      java.lang.String options
      (Optional) A SQL fragment appended to the generated DDL which creates this index.
      boolean unique
      (Optional) Whether the index is unique.
    • Element Detail

      • columnList

        java.lang.String columnList
        (Required) The columns included in the index, in order, following the BNF rule column_list given above.
      • name

        java.lang.String name
        (Optional) The name of the index.

        Defaults to a provider-generated name.

        Default:
        ""
      • unique

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

        java.lang.String options
        (Optional) A SQL fragment appended to the generated DDL which creates this index.
        Since:
        3.2
        Default:
        ""