Top Description Methods
jakarta.persistence

public @Interface Inheritance

extends Annotation
Annotations
@Target:TYPE
@Retention:RUNTIME
Imports
java.lang.annotation.Target, .Retention

Specifies the inheritance mapping strategy for the entity class hierarchy which descends from the annotated entity class.

This annotation must be applied to the entity class that is the root of the entity class hierarchy. If the Inheritance annotation is not specified, or if no inheritance type is specified for an entity class hierarchy, the SINGLE_TABLE mapping strategy is used.

Example:

@Entity @Inheritance(strategy = JOINED) public class Customer { ... } @Entity public class ValuedCustomer extends Customer { ... }
@Entity
@Inheritance(strategy = JOINED)
public class Customer { ... }

@Entity
public class ValuedCustomer extends Customer { ... }
Since
1.0
See Also
InheritanceType

Method Summary

Modifier and TypeMethod and Description
public InheritanceType
strategy()

The inheritance mapping strategy for the entity inheritance hierarchy.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

strategyback to summary
public InheritanceType strategy()

The inheritance mapping strategy for the entity inheritance hierarchy.