Annotation Interface DiscriminatorValue
The DiscriminatorValue annotation can only be
specified on a concrete entity class. Specifies the value of the
discriminator column for entities of the given type.
The DiscriminatorValue annotation can only be
specified on a concrete entity class.
If the DiscriminatorValue annotation is not
specified and a discriminator column is used, a
provider-specific function will be used to generate a value
representing the entity type. So the discriminator value default
is the
Class.getSimpleName().
Example usage of the DiscriminatorValue annotation:
@Entity
@DiscriminatorValue("Mammal")
public class Animal {
// Animal-specific fields and methods
}
@Entity
@DiscriminatorValue("Dog")
public class Dog extends Animal {
// Dog-specific fields and methods
}
- Since:
- 1.0.0
- See Also:
-
Required Element Summary
Required Elements
-
Element Details
-
value
String value(Optional) The value that indicates that the row is an entity of the annotated entity type.- Returns:
- the discriminator Value
-