2.7.23 @Inheritance

Organization of this subsection
(1) Description
(2) Element

(1) Description

This annotation specifies the inheritance mapping strategy used in the inheritance hierarchy of an entity.

@Inheritance is specified in the parent entity class of inheritance hierarchy.

The following are two types of inheritance mapping strategy available with Cosminexus JPA provider:

For details on the inheritance mapping strategy, see 6.13.2 Inheritance mapping strategy in the uCosminexus Application Server Common Container Functionality Guide.

The applicable target is class.

(2) Element

The following table lists the elements of @Inheritance:

Element nameOptional/RequiredElement description
strategyOptionalThis element specifies the type of inheritance mapping strategy.

The details of attributes that are supported with Cosminexus JPA provider are as follows:

(a) strategy element
Type
InheritanceType
Description
This element specifies the type of inheritance mapping strategy used in an entity.
The following two types of values can be specified:
  • InheritanceType.SINGLE_TABLE: This strategy is used to map all classes in the inheritance hierarchy to a single table.
  • InheritanceType.JOINED: This strategy is used to map the top most (parent class) of the inheritance hierarchy to a single table, and map each subclass with a subclass--specific mapping.
Default value
InheritanceType.SINGLE_TABLE