- All Implemented Interfaces:
Serializable,Comparable<InheritanceType>,Constable
The kind of inheritance.
- Author:
- harald
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMulti table.
Each entity in the inheritance hierarchy has its own table.
The super-entity is abstract and cannot have instances.There is no inheritance at all.
This is the default.
The concrete entities, i.e.OO inheritance only.
The entity extends its super-entity only in plain old java style.Single table.
Entities of all subtypes are stored in a single table.
The super-entity is abstract and cannot have instances. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether entity may have instances.booleanReturns whether entity does not map to any table.booleanReturns whether entity provides its own table.booleanReturns whether entity maps to the table of the hierarchy root.static 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
-
NONE
There is no inheritance at all.
This is the default.
The concrete entities, i.e. the leafs of the inheritance hierarchy are of typeNONE. -
PLAIN
OO inheritance only.
The entity extends its super-entity only in plain old java style. The mapping to the relational backend is unaffected.
Allows sharing of common attributes and/or methods.
The super-entity is abstract and cannot have instances. -
SINGLE
Single table.
Entities of all subtypes are stored in a single table.
The super-entity is abstract and cannot have instances. The table automatically gets an extra column "classId" to denote the concrete class. Persistence operations such as selects are allowed in the super entity and automatically create instances of the concrete type. -
MULTI
Multi table.
Each entity in the inheritance hierarchy has its own table.
The super-entity is abstract and cannot have instances. The table of the superclass automatically gets an extra column "classId" to denote the concrete class. Persistence operations such as selects are allowed in the super entity and automatically create instances of the concrete type.
The tables are joined by their common id.
-
-
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
-
isAbstractClass
public boolean isAbstractClass()Returns whether entity may have instances.- Returns:
- true if this entity may have instances
-
isMappingToOwnTable
public boolean isMappingToOwnTable()Returns whether entity provides its own table.- Returns:
- true if this entity provides its own table
-
isMappingToSuperTable
public boolean isMappingToSuperTable()Returns whether entity maps to the table of the hierarchy root.- Returns:
- true if this entity maps to the table of the hierarchy root
-
isMappingToNoTable
public boolean isMappingToNoTable()Returns whether entity does not map to any table.- Returns:
- true if not mapping
-