One-to-Many Mapping |
Use a One-to-Many Mapping to define a relationship with one-to-many multiplicity.
In the Persistence Outline View, select the field to map. The Persistence Properties View (for Attributes) displays the properties for the selected.
In the Map As field, select One-to-many.
Use this table to complete the fields on the General tab in the Persistence Properties view.
Property | Description | Default |
---|---|---|
Target Entity | The entity to which this attribute is mapped. |
|
Cascade Type | See "Cascade Type" for details.
|
|
Fetch Type | Defines how data is loaded from the database. See "Fetch Type" for details.
|
|
Mapped By | The database field that owns the relationship. |
|
Order By | Specify the default order for objects returned from a query. See "Ordered By" for details.
|
Primary key |
Use this table to complete the fields on the Join Table tab in the Persistence Properties view.
Property | Description | Default |
---|---|---|
Name | Name of the join table | By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore. |
Join Columns |
|
|
Inverse Join Columns |
|
|
Eclipse adds the following annotations to the field:
@Version
@Column(name="<COLUMN>")