Annotation Type Table


@Target(TYPE) @Retention(RUNTIME) public @interface Table
Complementary information to a table either primary or secondary
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    name of the targeted table
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    define a table comment
    If set to 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.
    Defines the Foreign Key name of a secondary table pointing back to the primary table
    Indexes
    boolean
    If true, Hibernate will not try to insert or update the properties defined by this join.
    boolean
    If enabled, Hibernate will insert a row only if the properties defined by this join are non-null and will always use an outer join to retrieve the properties.
    Defines a custom SQL delete statement Only applies to secondary tables
    Defines a custom SQL insert statement Only applies to secondary tables
    Defines a custom SQL update statement Only applies to secondary tables
  • Element Details

    • appliesTo

      String appliesTo
      name of the targeted table
    • indexes

      Index[] indexes
      Indexes
      Default:
      {}
    • comment

      String comment
      define a table comment
      Default:
      ""
    • foreignKey

      ForeignKey foreignKey
      Defines the Foreign Key name of a secondary table pointing back to the primary table
      Default:
      @org.hibernate.annotations.ForeignKey(name="")
    • fetch

      FetchMode fetch
      If set to 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 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 defined by the class and its superclasses. Only applies to secondary tables
      Default:
      JOIN
    • inverse

      boolean inverse
      If true, Hibernate will not try to insert or update the properties defined by this join. Only applies to secondary tables
      Default:
      false
    • optional

      boolean optional
      If enabled, Hibernate will insert a row only if the properties defined by this join are non-null and will always use an outer join to retrieve the properties. Only applies to secondary tables
      Default:
      true
    • sqlInsert

      SQLInsert sqlInsert
      Defines a custom SQL insert statement Only applies to secondary tables
      Default:
      @org.hibernate.annotations.SQLInsert(sql="")
    • sqlUpdate

      SQLUpdate sqlUpdate
      Defines a custom SQL update statement Only applies to secondary tables
      Default:
      @org.hibernate.annotations.SQLUpdate(sql="")
    • sqlDelete

      SQLDelete sqlDelete
      Defines a custom SQL delete statement Only applies to secondary tables
      Default:
      @org.hibernate.annotations.SQLDelete(sql="")