Use a class indicator field in the table of the root class table to indicate which subclass should be instantiated. The indicator field should not have an associated direct mapping unless it is set to read-only.
You can use strings or numbers as values in the class indicator field. The root class descriptor must specify how the value in the class indicator field translates into the class to be instantiated. The following table illustrates the class indicator mapping from the Vehicle
class containing four entries.
Table 4-1 Class Indicator Mapping from the Vehicle Class
Key | Value |
---|---|
F | FueledVehicle |
N | NonFueledVehicle |
C | Car |
B | Bicycle |
When working with hierarchies more than two levels deep, the class indicator field and the class indicator mapping can be in only the root class.
Copyright © 1997, 2004, Oracle. All rights reserved.