Entering content frame

Function documentation Inheritance Mapping Locate the document in its SAP Library structure

Use

Inheritance is only supported with discriminator columns for performance reasons. Discriminator columns contain the type of a JDO instance.

Prerequisites

The discriminator column must not be a primary key column and must not allow null values.

Features

There are two ways of mapping a class hierarchy to a relational database:

·        Map all classes to a single table

·        Map all the fields declared in a subclass to columns of an additional table. This table contains these columns and primary columns that are equal to the primary key columns of the superclass.

The first approach is appropriate if a small number of classes are included in the hierarchy and the subclasses do not have many declared fields. The second approach is appropriate if many subclasses have many declared fields.

The mapping of a field to a column is inherited and cannot be redefined in a subclass. When using the second approach, you must include additional mapping information for the key fields in the subclasses. This information can be provided by adding the field element in the subclass with the attribute virtual set to true.

Note

All persistence capable classes in a class hierarchy must have the same Object ID class defined in the topmost persistence capable class.

 

 

Leaving content frame