Specifying Class Indicator
A source table has an indicator column that specifies the target table through the class indicator field, as show in the following illustration. The EMPLOYEE table has a TYPE column that indicates the target for the row (either PHONE or EMAIL).
The principles of defining such a variable class relationship are similar to defining a normal one-to-one relationship, except:
- The reference class is a Java interface, not a Java class. However, the method to set the interface is identical.
- You must specify a type indicator field.
- You specify the class indicator values on the mapping so that mapping can determine the class of object to create.
- You must specify the foreign key names and the respective abstract query keys from the target interface descriptor.
Related Topics
About TopLink Mapping Types
Working with Relationship Mappings
Working with Variable One-to-One Mappings
Copyright © 1997, 2004, Oracle.
All rights reserved.