Annotation Type Table

    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String appliesTo
      The name of the targeted table.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String checkConstraint
      A check constraint, written in native SQL.
      String comment
      Specifies comment to add to the generated DDL for the table.
      FetchMode fetch
      Defines a fetching strategy for the secondary table.
      ForeignKey foreignKey
      Deprecated.
      use SecondaryTable.foreignKey()
      Index[] indexes
      Deprecated.
      use Table.indexes() or SecondaryTable.indexes()
      boolean inverse
      If enabled, Hibernate will never insert or update the columns of the secondary table.
      boolean optional
      If enabled, Hibernate will insert a row only if the columns of the secondary table would not all be null, and will always use an outer join to read the columns.
      SQLDelete sqlDelete
      Defines a custom SQL delete statement.
      SQLInsert sqlInsert
      Defines a custom SQL insert statement.
      SQLUpdate sqlUpdate
      Defines a custom SQL update statement.
    • Element Detail

      • appliesTo

        String appliesTo
        The name of the targeted table.
      • indexes

        @Deprecated(since="6.0")
        Index[] indexes
        Deprecated.
        use Table.indexes() or SecondaryTable.indexes()
        Indexes.
        Default:
        {}
      • checkConstraint

        String checkConstraint
        A check constraint, written in native SQL.

        Useful for secondary tables, otherwise use Check.

        See Also:
        Check
        Default:
        ""
      • comment

        String comment
        Specifies comment to add to the generated DDL for the table.

        Useful for secondary tables, otherwise use Comment.

        See Also:
        Comment
        Default:
        ""
      • foreignKey

        @Deprecated(since="6.0")
        ForeignKey foreignKey
        Deprecated.
        use SecondaryTable.foreignKey()
        Specifies a foreign key of a secondary table, which points back to the primary table.
        Default:
        @org.hibernate.annotations.ForeignKey(name="")
      • fetch

        FetchMode fetch
        Defines a fetching strategy for the secondary table.
        • If set to FetchMode.JOIN, the default, Hibernate will use an inner join to retrieve a secondary table defined by a class or its superclasses and an outer join for a secondary table defined by a subclass.
        • If set to FetchMode.SELECT then Hibernate will use a sequential select for a secondary table defined on a subclass, which will be issued only if a row turns out to represent an instance of the subclass. Inner joins will still be used to retrieve a secondary table defined by the class and its superclasses.

        Only applies to secondary tables.

        Default:
        org.hibernate.annotations.FetchMode.JOIN
      • inverse

        boolean inverse
        If enabled, Hibernate will never insert or update the columns of the secondary table.

        Only applies to secondary tables.

        Default:
        false
      • optional

        boolean optional
        If enabled, Hibernate will insert a row only if the columns of the secondary table would not all be null, and will always use an outer join to read the columns. Thus, by default, Hibernate avoids creating a row of null values.

        Only applies to secondary tables.

        Default:
        true
      • sqlInsert

        SQLInsert sqlInsert
        Defines a custom SQL insert statement.

        Only applies to secondary tables.

        See Also:
        SQLInsert
        Default:
        @org.hibernate.annotations.SQLInsert(sql="")
      • sqlUpdate

        SQLUpdate sqlUpdate
        Defines a custom SQL update statement.

        Only applies to secondary tables.

        See Also:
        SQLUpdate
        Default:
        @org.hibernate.annotations.SQLUpdate(sql="")
      • sqlDelete

        SQLDelete sqlDelete
        Defines a custom SQL delete statement.

        Only applies to secondary tables.

        See Also:
        SQLDelete
        Default:
        @org.hibernate.annotations.SQLDelete(sql="")