ObjectDB ObjectDB

JoinColumn.referencedColumnName - JPA annotation element

Annotation Element
javax.persistence.JoinColumn
String referencedColumnName

(Optional) The name of the column referenced by this foreign key column.
  • When used with entity relationship mappings other than the cases described here, the referenced column is in the table of the target entity.
  • When used with a unidirectional OneToMany foreign key mapping, the referenced column is in the table of the source entity.
  • When used inside a JoinTable annotation, the referenced key column is in the entity table of the owning entity, or inverse entity if the join is part of the inverse join definition.
  • When used in a CollectionTable mapping, the referenced column is in the table of the entity containing the collection.

Default (only applies if single join column is being used): The same name as the primary key column of the referenced table.

Default value:
""
Since:
JPA 1.0