Enum InheritanceType

    • 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 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.
    • 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​(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:
        IllegalArgumentException - if this enum type 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