javax.jdo.annotations

## Annotation Type Unique

-     @Target(value={TYPE,FIELD,METHOD})
       @Retention(value=RUNTIME)
       @Repeatable(value=Uniques.class)
      public @interface Unique

  Annotation for a database unique constraint. Used for database schema generation to create unique constraints. Also used to reorder database operations when flushing changes to avoid unique constraint violations. Corresponds to the xml element "unique".
  Since:
    2.1
  Version:
    3.2

- - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `Column[]` | `columns` Columns that compose this unique constraint.
    `String` | `deferred` Whether this unique constraint is deferred until commit.
    `Extension[]` | `extensions` Vendor extensions.
    `String[]` | `members` Member (field and property) names that compose this unique constraint.
    `String` | `name` Name of the unique constraint.
    `String` | `table` Table for the unique constraint.

- - ### Element Detail

    - #### name

          public abstract String name

      Name of the unique constraint.
      Returns:
        the name of the unique constraint
      Default:
        ""

  - - #### table

          public abstract String table

      Table for the unique constraint. This is needed iff annotating a type where this unique constraint is not for the primary table for the persistent class or interface.
      Returns:
        the table on which the unique constraint is defined
      Default:
        ""

  - - #### deferred

          public abstract String deferred

      Whether this unique constraint is deferred until commit.
      Returns:
        whether this unique constraint is deferred until commit
      Default:
        ""

  - - #### members

          public abstract String[] members

      Member (field and property) names that compose this unique constraint.
      Returns:
        member names that compose this unique constraint
      Default:
        {}

  - - #### columns

          public abstract Column[] columns

      Columns that compose this unique constraint.
      Returns:
        columns that compose this unique constraint
      Default:
        {}

  - - #### extensions

          public abstract Extension[] extensions

      Vendor extensions.
      Returns:
        the vendor extensions
      Default:
        {}

Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.