Package org.hibernate.annotations
Annotation Type Table
-
@Target(TYPE) @Retention(RUNTIME) @Repeatable(Tables.class) public @interface Table
Complementary information for a table declared using theTable, orSecondaryTableannotation. Usually used only for secondary tables.- See Also:
Table,SecondaryTable
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description StringcheckConstraintA check constraint, written in native SQL.StringcommentSpecifies comment to add to the generated DDL for the table.FetchModefetchDefines a fetching strategy for the secondary table.ForeignKeyforeignKeyDeprecated.Index[]indexesDeprecated.booleaninverseIf enabled, Hibernate will never insert or update the columns of the secondary table.booleanoptionalIf 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.SQLDeletesqlDeleteDefines a custom SQL delete statement.SQLInsertsqlInsertDefines a custom SQL insert statement.SQLUpdatesqlUpdateDefines a custom SQL update statement.
-
-
-
Element Detail
-
appliesTo
String appliesTo
The name of the targeted table.
-
-
-
indexes
@Deprecated(since="6.0") Index[] indexes
Deprecated.Indexes.- Default:
- {}
-
-
-
foreignKey
@Deprecated(since="6.0") ForeignKey foreignKey
Deprecated.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.SELECTthen 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
- If set to
-
-
-
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
-
-