- java.lang.Object
-
- java.lang.Enum<InheritanceType>
-
- org.tentackle.model.InheritanceType
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<InheritanceType>
public enum InheritanceType extends java.lang.Enum<InheritanceType>
The kind of inheritance.- Author:
- harald
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MULTIMulti table.
Each entity in the inheritance hierarchy has its own table.
The super-entity is abstract and cannot have instances.NONEThere is no inheritance at all.
This is the default.
The concrete entities, i.e.PLAINOO inheritance only.
The entity extends its super-entity only in plain old java style.SINGLESingle table.
Entities of all subtypes are stored in a single table.
The super-entity is abstract and cannot have instances.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisAbstractClass()Returns whether entity may have instances.booleanisMappingToNoTable()Returns whether entity does not map to any table.booleanisMappingToOwnTable()Returns whether entity provides its own table.booleanisMappingToSuperTable()Returns whether entity maps to the table of the hierarchy root.static InheritanceTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static InheritanceType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final InheritanceType 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
public static final InheritanceType 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
public static final InheritanceType 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
public static final InheritanceType 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 Detail
-
values
public static InheritanceType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (InheritanceType c : InheritanceType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static InheritanceType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- 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
-
-