Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Configuring a Relational One-to-Many Mapping (ELUG)"
m (New page: <div style="float:right;border:1px solid #000000;padding:5px">__TOC__ Related Topics</div> This section descr...) |
m (→Introduction to Relational One-to-Many Mapping Configuration) |
||
Line 105: | Line 105: | ||
+ | This example shows how to create a one-to-many mapping and add it to a descriptor using Java code. | ||
+ | |||
+ | <span id="Example 40-1"></span> | ||
+ | ''''' One-to-Many Mapping''''' | ||
+ | |||
+ | <pre> | ||
+ | public void customize(ClassDescriptor descriptor) { | ||
+ | OneToManyMapping mapping = new OneToManyMapping(); | ||
+ | |||
+ | // configure mapping | ||
+ | ... | ||
+ | |||
+ | // add mapping to descriptor | ||
+ | descriptor.addMapping(mapping); | ||
+ | } | ||
+ | </pre> | ||
For more information, see the following: | For more information, see the following: | ||
Line 110: | Line 126: | ||
* [[Introduction%20to%20Relational%20Mappings%20(ELUG)|One-to-Many Mapping]] | * [[Introduction%20to%20Relational%20Mappings%20(ELUG)|One-to-Many Mapping]] | ||
* [[Configuring%20a%20Relational%20Mapping%20(ELUG)|Configuring a Relational Mapping]] | * [[Configuring%20a%20Relational%20Mapping%20(ELUG)|Configuring a Relational Mapping]] | ||
+ | * [[Creating%20and%20Configuring%20Mappings%20(ELUG)|Creating and Configuring Mappings]] | ||
For information on using JPA to configure one-to-many mappings, see [[Introduction%20to%20EclipseLink%20JPA%20(ELUG)|@OneToMany]]. | For information on using JPA to configure one-to-many mappings, see [[Introduction%20to%20EclipseLink%20JPA%20(ELUG)|@OneToMany]]. |
Revision as of 15:11, 29 November 2007
This section describes the various components that you must configure in order to use a relational one-to-many mapping.
For information on how to configure EclipseLink mappings options common to two or more mapping types, see Configuring a Mapping.
For information on how to create EclipseLink mappings, see Creating a Mapping.
Configurable Options for Relational One-to-Many Mapping lists the configurable options for a relational one-to-many mapping.
Introduction to Relational One-to-Many Mapping Configuration
This table lists the configurable options for a relational one-to-many mapping.
Configurable Options for Relational One-to-Many Mapping
Option | Workbench | Java |
---|---|---|
This example shows how to create a one-to-many mapping and add it to a descriptor using Java code.
One-to-Many Mapping
public void customize(ClassDescriptor descriptor) { OneToManyMapping mapping = new OneToManyMapping(); // configure mapping ... // add mapping to descriptor descriptor.addMapping(mapping); }
For more information, see the following:
For information on using JPA to configure one-to-many mappings, see @OneToMany.