Skip to main content

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.

Jump to: navigation, search

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/Introduction to Relational Mappings (ELUG)|Related Topics]]</div>
+
[[Special:Whatlinkshere/One-to-One Mapping (ELUG)|Related Topics]]</div>
This section describes the various components that you must configure in order to use a relational one-to-one mapping.
+
 
+
For information on how to configure EclipseLink mappings options common to two or more mapping types, see [[Configuring%20a%20Mapping%20(ELUG)|Configuring a Mapping]].
+
  
 
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]].
 
[[#Table 36-1|Configurable Options for Relational One-to-One Mapping]] lists the configurable options for a relational one-to-one mapping.
 
 
 
 
==Introduction to Relational One-to-One Mapping Configuration==
 
  
 
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>
''''' Configurable Options for Relational One-to-One Mapping'''''
+
{| 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 and categorizes them as Basic and Advanced and indicates if the option can be configured with the TopLink Workbench, Java, or both." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all"
+
 
|- 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" |
Reference descriptor (see [[Configuring%20a%20Relational%20Mapping%20(ELUG)|Configuring Reference Descriptor]])
+
[[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" |
Method or direct field access (see [[Configuring%20a%20Mapping%20(ELUG)|Configuring a Type Conversion Converter]])
+
[[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" |
Read-only mapping (see [[Configuring%20a%20Mapping%20(ELUG)|Configuring Read-Only Mappings]])
+
[[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" |
Private or Independent relationships (see [[Configuring%20a%20Mapping%20(ELUG)|Configuring Mapping Comments]])
+
[[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" |
Batch reading (see [[Configuring%20a%20Relational%20Mapping%20(ELUG)|Configuring Batch Reading]])
+
[[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" |
Joining (see [[Configuring%20a%20Relational%20Mapping%20(ELUG)|Configuring Joining at the Mapping Level]])
+
[[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" |
Indirection (lazy loading) (see [[Configuring%20a%20Mapping%20(ELUG)|Configuring Mapping Comments]])
+
[[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" |
Bidirectional relationship (see [[Configuring%20a%20Mapping%20(ELUG)|Configuring Bidirectional Relationship]])
+
[[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" |
Mapping comments (see [[Configuring%20a%20Mapping%20(ELUG)|Configuring Mapping Comments]])
+
[[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" |
Table and field references (see [[Configuring%20a%20Relational%20Mapping%20(ELUG)|Configuring Joining at the Mapping Level]])
+
[[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.
  
For more information, see the following:
+
<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: Draft]]
+
[[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

Reference descriptor

Supported

Supported

Method or direct field access

Supported

Supported

Read-only mapping

Supported

Supported

Private or Independent relationships

Supported

Supported

Batch reading

Supported

Supported

Joining

Supported

Supported

Indirection (lazy loading)

Supported

Supported

Bidirectional relationship

Supported

Supported

Mapping comments

Supported

Supported

Table and field references

Supported

Supported


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.



Copyright Statement

Back to the top