Java Reference
In-Depth Information
The Java Persistence API defines some other relationship annotations for mapping
EJB 3.0 entity relationships. These annotations are discussed in the following table:
Annotation
Description
Annotation Elements
@JoinTable
This specifies the join table
for mapping of associations.
The default join table name
is the table names of the
associated primary tables
concatenated together
(owning-side first) using
an underscore. Specified on
the owning side of a many-
to-many association or in a
unidirectional one-to-many
association.
name (optional): The name of
the join table.
catalog (optional): The
catalog of the table.
schema (optional): The
schema of the table.
joinColumns (optional):
The foreign key columns
of the join table that
reference the primary table
of the entity owning the
association.
inverseJoinColumns
(optional): The foreign key
columns of the join table that
reference the primary table
of the non-owning entity.
uniqueConstraints
(optional): Unique
constraints on the table.
@JoinColumns
This defines composite
foreign keys. Groups @
JoinColumn annotations
for a relationship.
The name and
referencedColumnName
elements must be
specified for each of the @
JoinColumn .
value (optional): This
specifies an array of
JoinColumn .
Search WWH ::




Custom Search