Enum Class InheritanceType

java.lang.Object
java.lang.Enum<InheritanceType>
org.tentackle.model.InheritanceType
All Implemented Interfaces:
Serializable, Comparable<InheritanceType>, Constable

public enum InheritanceType extends Enum<InheritanceType>
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 Constants
    Enum Constant
    Description
    Embedded in parent object.
    Composition sometimes is a good alternative to inheritance.
    Multi 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 Type
    Method
    Description
    boolean
    Returns whether entity may have instances.
    boolean
    Returns whether entity does not map to any table.
    boolean
    Returns whether entity provides its own table.
    boolean
    Returns whether entity maps to the table of the hierarchy root.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • 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 type NONE.
    • 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.
    • EMBEDDED

      public static final InheritanceType EMBEDDED
      Embedded in parent object.
      Composition sometimes is a good alternative to inheritance. Embedded entities are treated just like eager 1:1 relations from a Java perspective. However, their columns are stored in the table of the embedding entity.
  • Method Details

    • values

      public static InheritanceType[] 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

      public static InheritanceType valueOf(String name)
      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 name
      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