JoinColumn.table - JPA annotation element

Annotation Element
javax.persistence.JoinColumn
String table

(Optional) The name of the table that contains the column. If a table is not specified, the column is assumed to be in the primary table of the applicable entity.

Default:

  • If the join is for a OneToOne or ManyToOne mapping using a foreign key mapping strategy, the name of the table of the source entity or embeddable.
  • If the join is for a unidirectional OneToMany mapping using a foreign key mapping strategy, the name of the table of the target entity.
  • If the join is for a ManyToMany mapping or for a OneToOne or bidirectional ManyToOne/OneToMany mapping using a join table, the name of the join table.
  • If the join is for an element collection, the name of the collection table.
Default value:
""
Since:
JPA 1.0