Annotation Interface Table


@Documented @Retention(RUNTIME) @Target(TYPE) public @interface Table
Annotation to define a database table mapping for an entity.

This annotation specifies the table name and any unique constraints that should be applied to the table in the database.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specifies the name of the table in the database.
    Defines unique constraints applied to one or more columns of the table.
  • Element Details

    • name

      String name
      Specifies the name of the table in the database.

      If left empty, the class name will be used as the table name by default.

      Returns:
      The table name.
      Default:
      ""
    • uniqueConstraints

      UniqueConstraint[] uniqueConstraints
      Defines unique constraints applied to one or more columns of the table.

      The column names must refer to the actual database column names, not entity class field names.

      Returns:
      An array of UniqueConstraint annotations specifying the unique constraints.
      Default:
      {}