A root/leaf inheritance map is similar to the single table inheritance map, except that each subclass may have additional information to the superclass and this information will be stored in a separate table. When the subclass is instantiated, it will obtain its information from its table as well as from the superclasses' table. An example of this type of mapping can be found in the AutoWorld example.
Launch the Model Browser and select AutoWorld from the Models view. Double-click on VapVehicle to expand its hierarchy.
Below is a diagram of the class hierarchy for VapVehicle in the Model Browser.
If you open the Schema Browser and select AutoWorld, you will notice that there is a separate table for each of the model objects in the VapVehicle class hierarchy (VEHICLE, BUS, AUTOMOBILE, RACECAR).
Each of the leaf tables (AUTOMOBILE, RACECAR, and so on) have foreign key relationships to their parent table. The important part of this example is how the models from the Model Browser are mapped to the tables in the Schema Browser. This can seen in the Map Browser.
This opens the Root Leaf Inheritance Map editor.
Note that a discriminator value is not entered for the VEHICLE table because the VapVehicle is only an abstract class and cannot be instantiated. If, in your application, the root of the model hierarchy can be instantiated, you must enter the discriminator value.
This opens the Root Leaf Inheritance Map editor.
This opens the Root Leaf Inheritance Map editor.
The root/leaf inheritance table map is now defined.