Hitachi

uCosminexus Application Server Compatibility Guide


8.12.23 @Inheritance

Organization of this subsection

(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 9.13.2 Inheritance mapping strategy.

The applicable target is class.

(2) Element

The following table lists the elements of @Inheritance:

Element name

Optional/Required

Element description

strategy

Optional

This 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