Annotation Type Index


  • @Target({})
    @Retention(RUNTIME)
    public @interface Index
    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 Elements 
      Modifier and Type Required Element Description
      java.lang.String columnList
      (Required) The names of the columns to be included in the index.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String name
      (Optional) The name of the index.
      boolean unique
      (Optional) Whether the index is unique.
    • Element Detail

      • columnList

        java.lang.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

        java.lang.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