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.
Configuring a Mapping (ELUG)
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 a Mapping.
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 |
---|---|---|
Table and field references (see Configuring Joining at the Mapping Level) |
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.