Skip Headers

Oracle TopLink Developer's Guide 10g Release 3 (10.1.3) B13593-01 |
| Home | Solution Area | Contents | Index

Previous | Next |

# Variable One-to-One Mapping

Variable class relationships are similar to polymorphic relationships, except that in this case the target classes are not related through inheritance (and thus not good candidates for an abstract table), but through an interface.

To define variable class relationships in TopLink Workbench, use the variable one-to-one mapping selection, but choose the interface as the reference class. This makes the mapping a variable one-to-one. When defining mappings in Java code, use the `VariableOneToOneMapping` class.

TopLink supports variable relationships only in one-to-one mappings. It handles this relationship in two ways:

- Through the class indicator field (see "Configuring Class Indicator").

- Through unique primary key values among target classes implementing the interface (see "Configuring Unique Primary Key").

Figure 36-3 Variable One-to-One Mappings with Class Indicator

Description of "Figure 36-3 Variable One-to-One Mappings with Class Indicator"

See "Configuring a Relational Variable One-to-One Mapping" for more information.