Enum Class InheritanceType
- All Implemented Interfaces:
Serializable, Comparable<InheritanceType>, Constable
- Since:
- 1.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA table for each abstract or concrete entity class, with only the columns mapped to persistent fields and properties declared by the entity class.A single table for each entity class hierarchy.A table for each concrete entity class. -
Method Summary
Modifier and TypeMethodDescriptionstatic InheritanceTypeReturns the enum constant of this class with the specified name.static InheritanceType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SINGLE_TABLE
A single table for each entity class hierarchy.In this strategy, all classes in a hierarchy map to the same table. The table has a column serving as a discriminator column.
Subclasses are stored together with the root class, and each entity instance is stored as a single table row. The concrete subclass represented by a row is determined by the value held by the discriminator column.
-
TABLE_PER_CLASS
A table for each concrete entity class.In this mapping strategy, each concrete class in the hierarchy is mapped to a completely separate table. Every attribute of the class, including inherited attributes, maps to a column or columns of the table belonging to the concrete class.
Each concrete class in the hierarchy has its own table, and each entity instance is stored as a single table row. No discriminator column is necessary.
-
JOINED
A table for each abstract or concrete entity class, with only the columns mapped to persistent fields and properties declared by the entity class.In this strategy:
- The root of the class hierarchy is represented by a table with columns mapped by attributes declared by the root class.
- Each subclass is represented by a separate table containing only those columns that are mapped by attributes declared by that subclass (and not inherited from its superclass), along with the column or columns holding its primary key. The primary key of the subclass table doubles as a foreign key of the superclass table.
Each class in the hierarchy has its own table, but that table does not contain columns mapped to inherited fields or properties, and so the state of an entity instance might be stored across multiple table rows. A join is used to retrieve the state of such entities.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-