Notice: this Wiki will be going read only early in 2024 and edits will no longer be 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-One Mapping (ELUG)"
m (New page: <div style="float:right;border:1px solid #000000;padding:5px">__TOC__ Related Topics</div> This section describes the v...) |
m |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<div style="float:right;border:1px solid #000000;padding:5px">__TOC__ | <div style="float:right;border:1px solid #000000;padding:5px">__TOC__ | ||
− | [[Special:Whatlinkshere/ | + | [[Special:Whatlinkshere/One-to-One Mapping (ELUG)|Related Topics]]</div> |
− | + | ||
− | + | ||
− | + | ||
For information on how to create EclipseLink mappings, see [[Creating%20a%20Mapping%20(ELUG)|Creating a Mapping]]. | For information on how to create EclipseLink mappings, see [[Creating%20a%20Mapping%20(ELUG)|Creating a Mapping]]. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
This table lists the configurable options for a relational one-to-one mapping. | This table lists the configurable options for a relational one-to-one mapping. | ||
Line 17: | Line 8: | ||
<span id="Table 36-1"></span> | <span id="Table 36-1"></span> | ||
− | + | {| class="RuleFormalMax" dir="ltr" title="Configurable Options for Relational One-to-One Mapping" summary="This table lists the configurable options common to Relational One-to-One Mapping and indicates if the option can be configured with the Workbench, Java, or both." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | |
− | + | ||
− | {| class="RuleFormalMax" dir="ltr" title="Configurable Options for Relational One-to-One Mapping" summary="This table lists the configurable options common to Relational One-to-One Mapping | + | |
|- align="left" valign="top" | |- align="left" valign="top" | ||
! id="r1c1-t2" align="left" valign="bottom" | '''Option to Configure''' | ! id="r1c1-t2" align="left" valign="bottom" | '''Option to Configure''' | ||
Line 26: | Line 15: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r2c1-t2" headers="r1c1-t2" align="left" | | | id="r2c1-t2" headers="r1c1-t2" align="left" | | ||
− | + | [[Configuring%20a%20Relational%20Mapping%20(ELUG)#Configuring Reference Descriptor|Reference descriptor ]] | |
| headers="r2c1-t2 r1c2-t2" align="left" | | | headers="r2c1-t2 r1c2-t2" align="left" | | ||
[[Image:support.gif|Supported]] | [[Image:support.gif|Supported]] | ||
Line 33: | Line 22: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r3c1-t2" headers="r1c1-t2" align="left" | | | id="r3c1-t2" headers="r1c1-t2" align="left" | | ||
− | + | [[Configuring%20a%20Mapping%20(ELUG)#Configuring Method or Direct Field Accessing at the Mapping Level|Method or direct field access]] | |
| headers="r3c1-t2 r1c2-t2" align="left" | | | headers="r3c1-t2 r1c2-t2" align="left" | | ||
[[Image:support.gif|Supported]] | [[Image:support.gif|Supported]] | ||
Line 40: | Line 29: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r4c1-t2" headers="r1c1-t2" align="left" | | | id="r4c1-t2" headers="r1c1-t2" align="left" | | ||
− | + | [[Configuring%20a%20Mapping%20(ELUG)#Configuring Read-Only Mappings|Read-only mapping ]] | |
| headers="r4c1-t2 r1c2-t2" align="left" | | | headers="r4c1-t2 r1c2-t2" align="left" | | ||
[[Image:support.gif|Supported]] | [[Image:support.gif|Supported]] | ||
Line 47: | Line 36: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r5c1-t2" headers="r1c1-t2" align="left" | | | id="r5c1-t2" headers="r1c1-t2" align="left" | | ||
− | + | [[Configuring%20a%20Mapping%20(ELUG)#Configuring Private or Independent Relationships|Private or Independent relationships]] | |
| headers="r5c1-t2 r1c2-t2" align="left" | | | headers="r5c1-t2 r1c2-t2" align="left" | | ||
[[Image:support.gif|Supported]] | [[Image:support.gif|Supported]] | ||
Line 54: | Line 43: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r6c1-t2" headers="r1c1-t2" align="left" | | | id="r6c1-t2" headers="r1c1-t2" align="left" | | ||
− | + | [[Configuring%20a%20Relational%20Mapping%20(ELUG)#Configuring Batch Reading|Batch reading ]] | |
| headers="r6c1-t2 r1c2-t2" align="left" | | | headers="r6c1-t2 r1c2-t2" align="left" | | ||
[[Image:support.gif|Supported]] | [[Image:support.gif|Supported]] | ||
Line 61: | Line 50: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r7c1-t2" headers="r1c1-t2" align="left" | | | id="r7c1-t2" headers="r1c1-t2" align="left" | | ||
− | + | [[Configuring%20a%20Relational%20Mapping%20(ELUG)#Configuring Joining at the Mapping Level|Joining ]] | |
| headers="r7c1-t2 r1c2-t2" align="left" | | | headers="r7c1-t2 r1c2-t2" align="left" | | ||
[[Image:support.gif|Supported]] | [[Image:support.gif|Supported]] | ||
Line 68: | Line 57: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r8c1-t2" headers="r1c1-t2" align="left" | | | id="r8c1-t2" headers="r1c1-t2" align="left" | | ||
− | + | [[Configuring%20a%20Mapping%20(ELUG)#Configuring Indirection (Lazy Loading)|Indirection (lazy loading)]] | |
| headers="r8c1-t2 r1c2-t2" align="left" | | | headers="r8c1-t2 r1c2-t2" align="left" | | ||
[[Image:support.gif|Supported]] | [[Image:support.gif|Supported]] | ||
Line 75: | Line 64: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r9c1-t2" headers="r1c1-t2" align="left" | | | id="r9c1-t2" headers="r1c1-t2" align="left" | | ||
− | + | [[Configuring%20a%20Mapping%20(ELUG)#Configuring Bidirectional Relationship|Bidirectional relationship ]] | |
| headers="r9c1-t2 r1c2-t2" align="left" | | | headers="r9c1-t2 r1c2-t2" align="left" | | ||
[[Image:support.gif|Supported]] | [[Image:support.gif|Supported]] | ||
Line 82: | Line 71: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r10c1-t2" headers="r1c1-t2" align="left" | | | id="r10c1-t2" headers="r1c1-t2" align="left" | | ||
− | + | [[Configuring%20a%20Mapping%20(ELUG)#Configuring Mapping Comments|Mapping comments ]] | |
| headers="r10c1-t2 r1c2-t2" align="left" | | | headers="r10c1-t2 r1c2-t2" align="left" | | ||
[[Image:support.gif|Supported]] | [[Image:support.gif|Supported]] | ||
Line 89: | Line 78: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r11c1-t2" headers="r1c1-t2" align="left" | | | id="r11c1-t2" headers="r1c1-t2" align="left" | | ||
− | + | [[Configuring%20a%20Relational%20Mapping%20(ELUG)#Configuring Table and Field References (Foreign and Target Foreign Keys)|Table and field references]] | |
| headers="r11c1-t2 r1c2-t2" align="left" | | | headers="r11c1-t2 r1c2-t2" align="left" | | ||
[[Image:support.gif|Supported]] | [[Image:support.gif|Supported]] | ||
Line 97: | Line 86: | ||
+ | This example shows how to create a one-to-one mapping and add it to a descriptor using Java code. | ||
− | + | <span id="Example 38-1"></span> | |
+ | ''''' One-to-One Mapping''''' | ||
− | * [[Introduction%20to%20Relational%20Mappings%20(ELUG)|One-to-One Mapping]] | + | <pre> |
+ | public void customize(ClassDescriptor descriptor) { | ||
+ | OneToOneMapping mapping = new OneToOneMapping(); | ||
+ | |||
+ | // configure mapping | ||
+ | ... | ||
+ | |||
+ | // add mapping to descriptor | ||
+ | descriptor.addMapping(mapping); | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | For more information, see the following: | ||
+ | * [[Introduction%20to%20Relational%20Mappings%20(ELUG)#One-to-One Mapping|One-to-One Mapping]] | ||
* [[Configuring%20a%20Relational%20Mapping%20(ELUG)|Configuring a Relational Mapping]] | * [[Configuring%20a%20Relational%20Mapping%20(ELUG)|Configuring a Relational Mapping]] | ||
+ | * [[Configuring%20a%20Mapping%20(ELUG)|Configuring a Mapping]]. | ||
+ | |||
− | For information on using JPA to configure one-to-one mappings, see [[Introduction%20to%20EclipseLink%20JPA%20(ELUG)|@OneToOne]]. | + | For information on using JPA to configure one-to-one mappings, see [[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@OneToOne|@OneToOne]]. |
Line 112: | Line 119: | ||
[[Category: EclipseLink User's Guide]] | [[Category: EclipseLink User's Guide]] | ||
− | [[Category: | + | [[Category: Release 1]] |
[[Category: Task]] | [[Category: Task]] | ||
+ | [[Category: ORM]] |
Latest revision as of 07:38, 20 August 2008
For information on how to create EclipseLink mappings, see Creating a Mapping.
This table lists the configurable options for a relational one-to-one mapping.
Option to Configure | Workbench | Java |
---|---|---|
This example shows how to create a one-to-one mapping and add it to a descriptor using Java code.
One-to-One Mapping
public void customize(ClassDescriptor descriptor) { OneToOneMapping mapping = new OneToOneMapping(); // configure mapping ... // add mapping to descriptor descriptor.addMapping(mapping); }
For more information, see the following:
For information on using JPA to configure one-to-one mappings, see @OneToOne.