Oracle® Application Server TopLink Mapping Workbench User's Guide
10g Release 2 (10.1.2) Part No. B15900-01 |
|
Previous |
Next |
Inheritance describes how a child class inherits the characteristics of its parent class. TopLink uses multiple implementations to support database inheritance.
In the advanced tutorial, the LargeProject
and SmallProject
classes inherit the characteristics of the BaseProject
class. Use the following procedures to set the BaseProject
descriptor to implement inheritance, then enable the two subclasses.
To implement inheritance in the BaseProject descriptor:
Click the BaseProject
descriptor in the Navigator pane.
Click the Inheritance tab in the Editor pane.
If the Inheritance tab is not visible, right-click the Project descriptor and choose Advanced Properties > Inheritance from the pop-up menu or Selected > Advanced Properties > Inheritance from the menu.
Ensure that the Is Root Descriptor field is selected.
Select the Use Class Indicator Field option, and use the drop-down list to choose PROJ_TYPE
.
Select the Use Class Indicator Dictionary field and choose a String type as the Indicator Type.
To implement inheritance in each subclass:
Click the SmallProject
descriptor in the Navigator pane.
Click the Inheritance tab in the Editor pane.
If the Inheritance tab is not visible, right-click the SmallProject
descriptor and choose Advanced Properties > Inheritance from the pop-up menu or Selected > Advanced Properties > Inheritance from the menu.
In the Parent Descriptor drop-down list, choose the BaseProject
class.
Description of the illustration savebtn.gif
Click Save on the toolbar or choose File > Save Project to save the project.
Repeat this procedure for the LargeProject
descriptor.
To complete the inheritance:
Click the BaseProject
descriptor in the Navigator pane.
Click the Inheritance tab in the Editor pane.
Select the Read Sublcasses on Query option.
For each inherited descriptor:
Select the Include column.
Click Edit.
Enter an Indicator Value (S for SmallProject
and L for LargeProject
) for each child class.
Note: To have the root class store instances of itself in the table, it must include a value-subclass pair for itself. This is not required for the advanced tutorial becauseProject is an abstract class.
|