Skip Headers

# Configuring Class Indicator

Previous

Next

In variable one-to-one mappings, you can use an indicator column in the source table to specify the correct target table, as illustrated in Figure: Variable One-to-One Mapping using Class indicator Field. This section includes information on implementing class indicators.

A source table has an indicator column that specifies the target table through the class indicator field.

Figure: Variable One-to-One Mapping using Class indicator Field illustrates the EMPLOYEE table that has a TYPE column that indicates the target for the row (either PHONE or EMAIL).

Variable One-to-One Mapping using Class indicator Field

Description of "Variable One-to-One Mapping using Class indicator Field"

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.

Alternatively, you can use unique primary keys to specify the correct target. See "Configuring Unique Primary Key" for more information.