Understanding Root, Branch, and Leaf Classes in an Inheritance Hierarchy
TopLink allows three types of classes in an inheritance hierarchy:
- The root class stores information about all instantiable classes in its subclass hierarchy. By default, queries performed on the root class return instances of the root class and its instantiable subclasses. However, the root class can be configured so queries on it return only instances of itself without instances of its subclasses. For example, the Vehicle class in Example 4-19, "Supporting Inheritance Using One Table" is a root class.
- The branch classes have a persistent superclass and also have subclasses. By default, queries performed on the branch class return instances of the branch class and any of its subclasses. However, as with the root class, the branch class can be configured so queries on it return only instances of itself without instances of its subclasses. For example, the FueledVehicle class in Example 4-19, "Supporting Inheritance Using One Table" is a branch class.
- The leaf classes have a persistent superclass in the hierarchy but do not have subclasses. Queries performed on the leaf class can only return instances of the leaf class. For example, the Car class in Example 4-19, "Supporting Inheritance Using One Table" is a leaf class.
Related Topics
About TopLink Descriptors
Working with Descriptors
Working with Inheritance
Working with Descriptor Properties
Working with Advanced Properties
-
Finding Subclasses
Providing a Class Indicator Field
Specifying Primary Keys in an Inheritance Hierarchy
Mapping Inherited Attributes in a Subclass
Copyright © 1997, 2004, Oracle.
All rights reserved.