Top Description Methods
org.hibernate.annotations

public @Interface Table

extends Annotation
Annotations
@Target:TYPE
@Retention:RUNTIME
@Repeatable:Tables
@Deprecated
since:6.2
forRemoval:true
Imports
java.lang.annotation.Repeatable, .Retention, .Target

Deprecated

for removal since 6.2.

The options available here are all now offered by other newer and better-designed annotations in this package. This annotation will soon be removed, since it's very annoying to have two annotations named @Table.

Complementary information for a table declared using the jakarta.persistence.Table, or jakarta.persistence.SecondaryTable annotation. Usually used only for secondary tables.
Author
Emmanuel Bernard
See Also
jakarta.persistence.Table, jakarta.persistence.SecondaryTable

Method Summary

Modifier and TypeMethod and Description
public String
appliesTo()

The name of the targeted table.

public String
checkConstraint()

Deprecated since 6.2. use Check.
A check constraint, written in native SQL.
public String
comment()

Deprecated since 6.2. use Comment
Specifies comment to add to the generated DDL for the table.
public FetchMode
fetch()

Deprecated since 6.2. This setting has no effect in Hibernate 6
public ForeignKey
foreignKey()

Deprecated for removal since 6.0. use jakarta.persistence.SecondaryTable#foreignKey()
Specifies a foreign key of a secondary table, which points back to the primary table.
public Index[]
public boolean
inverse()

Deprecated since 6.2. use SecondaryRow#owned()
If enabled, Hibernate will never insert or update the columns of the secondary table.
public boolean
optional()

Deprecated since 6.2. use SecondaryRow#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.
public SQLDelete
sqlDelete()

Deprecated since 6.2. use SQLInsert#table() to specify the secondary table
Defines a custom SQL delete statement.
public SQLInsert
sqlInsert()

Deprecated since 6.2. use SQLInsert#table() to specify the secondary table
Defines a custom SQL insert statement.
public SQLUpdate
sqlUpdate()

Deprecated since 6.2. use SQLInsert#table() to specify the secondary table
Defines a custom SQL update statement.
Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

appliesToback to summary
public String appliesTo()

The name of the targeted table.

checkConstraintback to summary
public String checkConstraint()

Deprecated

since 6.2.

use Check.

A check constraint, written in native SQL.

Annotations
@Deprecated
since:6.2
commentback to summary
public String comment()

Deprecated

since 6.2.

use Comment

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

Annotations
@Deprecated
since:6.2
fetchback to summary
public FetchMode fetch()

Deprecated

since 6.2.

This setting has no effect in Hibernate 6

Annotations
@Deprecated
since:6.2
foreignKeyback to summary
public ForeignKey foreignKey()

Deprecated

for removal since 6.0.

use jakarta.persistence.SecondaryTable#foreignKey()

Specifies a foreign key of a secondary table, which points back to the primary table.

API Note

Only relevant to secondary tables

Annotations
@Deprecated
since:6.0
forRemoval:true
indexesback to summary
public Index[] indexes()

Indexes.

Annotations
@Deprecated
since:6.0
inverseback to summary
public boolean inverse()

Deprecated

since 6.2.

use SecondaryRow#owned()

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

API Note

Only relevant to secondary tables

Annotations
@Deprecated
since:6.2
optionalback to summary
public boolean optional()

Deprecated

since 6.2.

use SecondaryRow#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.

API Note

Only relevant to secondary tables

Annotations
@Deprecated
since:6.2
sqlDeleteback to summary
public SQLDelete sqlDelete()

Deprecated

since 6.2.

use SQLInsert#table() to specify the secondary table

Defines a custom SQL delete statement.

API Note

Only relevant to secondary tables

Annotations
@Deprecated
since:6.2
sqlInsertback to summary
public SQLInsert sqlInsert()

Deprecated

since 6.2.

use SQLInsert#table() to specify the secondary table

Defines a custom SQL insert statement.

API Note

Only relevant to secondary tables

Annotations
@Deprecated
since:6.2
sqlUpdateback to summary
public SQLUpdate sqlUpdate()

Deprecated

since 6.2.

use SQLInsert#table() to specify the secondary table

Defines a custom SQL update statement.

API Note

Only relevant to secondary tables

Annotations
@Deprecated
since:6.2