Class EntityImpl

  • All Implemented Interfaces:
    java.lang.Comparable<EntityImpl>, Entity, ModelElement

    public class EntityImpl
    extends java.lang.Object
    implements Entity, java.lang.Comparable<EntityImpl>
    The entity model implementation.
    Author:
    harald
    • Constructor Detail

      • EntityImpl

        public EntityImpl​(EntityFactoryImpl factory,
                          SourceInfo sourceInfo)
        Creates an entity.
        Parameters:
        factory - the factory to create entity options
        sourceInfo - the source information
    • Method Detail

      • getSourceInfo

        public SourceInfo getSourceInfo()
        Description copied from interface: ModelElement
        Gets the information about the source where this element is defined.
        Specified by:
        getSourceInfo in interface ModelElement
        Returns:
        the source info
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • compareTo

        public int compareTo​(EntityImpl o)
        Specified by:
        compareTo in interface java.lang.Comparable<EntityImpl>
      • parseConfiguration

        public boolean parseConfiguration​(ConfigurationLine line)
                                   throws ModelException
        Parses a configuration line.
        Parameters:
        line - the configuation line
        Returns:
        true if known configuration processed
        Throws:
        ModelException - if parsing failed
      • getName

        public java.lang.String getName()
        Description copied from interface: ModelElement
        Gets the name of the element.
        Specified by:
        getName in interface ModelElement
        Returns:
        the name
      • setName

        public void setName​(java.lang.String name)
        Sets the entity's name.
        Parameters:
        name - the name
      • getOrdinal

        public int getOrdinal()
        Description copied from interface: ModelElement
        Gets the ordinal along the inheritance path.
        Specified by:
        getOrdinal in interface ModelElement
        Returns:
        the ordinal, starting at 0
      • setOrdinal

        public void setOrdinal​(int ordinal)
      • getClassId

        public int getClassId()
        Description copied from interface: Entity
        Gets the unique id of this entity.
        A sort of class-ID that is used to map from a small number to a class or classname.
        Specified by:
        getClassId in interface Entity
        Returns:
        the entity class id
      • setClassId

        public void setClassId​(int classId)
        Sets the entity id.
        Parameters:
        classId - the id
      • getTableName

        public java.lang.String getTableName()
        Description copied from interface: Entity
        Gets the database table name.
        An optional schema may be prepended separated by a dot.

        Important: similar to the entity name, the table name must be unique among the whole model and all schemas. This restriction avoids unnecessary confusion and reduces the potential for errors in SQL statements.

        Specified by:
        getTableName in interface Entity
        Returns:
        the tablename (always in lowercase), null if entity doesn't map to its own table
      • getSchemaName

        public java.lang.String getSchemaName()
        Description copied from interface: Entity
        Gets the schema name.
        Specified by:
        getSchemaName in interface Entity
        Returns:
        the schema (always in lowercase), null if default
      • getTableNameWithoutSchema

        public java.lang.String getTableNameWithoutSchema()
        Description copied from interface: Entity
        Gets the tablename without the leading schema.

        Important: similar to the entity name, the table name must be unique among the whole model and all schemas. This restriction avoids unnecessary confusion and reduces the potential for errors in SQL statements.

        Specified by:
        getTableNameWithoutSchema in interface Entity
        Returns:
        the tablename relative to its schema (always in lowercase), null if entity doesn't map to its own table
      • getTableAlias

        public java.lang.String getTableAlias()
        Description copied from interface: Entity
        Gets the table alias for joined selects.
        The alias is unique among all tables. If the model does not provide an alias, a unique alias will be generated.
        Specified by:
        getTableAlias in interface Entity
        Returns:
        the table alias
      • getDefinedTableAlias

        public java.lang.String getDefinedTableAlias()
        Description copied from interface: Entity
        Gets the table alias originally configured in the model.
        Specified by:
        getDefinedTableAlias in interface Entity
        Returns:
        the fixed alias, null if automatic
      • setTableName

        public void setTableName​(java.lang.String tableName)
        Sets the tablename.
        Parameters:
        tableName - the tablename
      • setTableAlias

        public void setTableAlias​(java.lang.String tableAlias)
        Sets the table alias.
        Parameters:
        tableAlias - the alias
      • setDefinedTableAlias

        public void setDefinedTableAlias​(java.lang.String definedTableAlias)
        Sets the table alias defined by the model specification.
        Parameters:
        definedTableAlias - the original alias, null if automatic
      • getIntegrity

        public Integrity getIntegrity()
        Description copied from interface: Entity
        Gets the referential integrity mode.
        Specified by:
        getIntegrity in interface Entity
        Returns:
        the integrity mode
      • getSuperEntityName

        public java.lang.String getSuperEntityName()
        Description copied from interface: Entity
        Gets the name of the super class entity.
        Specified by:
        getSuperEntityName in interface Entity
        Returns:
        the super class name, null if not inherited
      • getSuperEntity

        public Entity getSuperEntity()
        Description copied from interface: Entity
        Gets the super class entity if inherited.
        Specified by:
        getSuperEntity in interface Entity
        Returns:
        the super entity, null if not inherited
      • getSuperEntities

        public java.util.List<Entity> getSuperEntities()
        Description copied from interface: Entity
        Gets all super entities.
        Specified by:
        getSuperEntities in interface Entity
        Returns:
        the path along up to the top super entity.
      • getTopSuperEntity

        public Entity getTopSuperEntity()
        Description copied from interface: Entity
        Gets the top most entity of the inheritance tree.
        Returns this entity if there is no inheritance.
        Specified by:
        getTopSuperEntity in interface Entity
        Returns:
        the root of the inheritance hierarchy
      • getInheritanceChain

        public java.util.List<Entity> getInheritanceChain​(Entity childEntity)
                                                   throws ModelException
        Description copied from interface: Entity
        Gets the inheritance chain from this entity down to given sub entity.
        Specified by:
        getInheritanceChain in interface Entity
        Parameters:
        childEntity - the sub entity
        Returns:
        the chain starting with this entity end ending with the sub entity
        Throws:
        ModelException - if subEntity does not inherit this entity
      • getSubEntities

        public java.util.List<Entity> getSubEntities()
        Description copied from interface: Entity
        Gets the direct sub entities.
        Specified by:
        getSubEntities in interface Entity
        Returns:
        the sub entities, empty list if no sub entities
      • getAllSubEntities

        public java.util.List<Entity> getAllSubEntities()
        Description copied from interface: Entity
        Gets all sub entities.
        Specified by:
        getAllSubEntities in interface Entity
        Returns:
        the sub entities, empty list if no sub entities
      • getLeafEntities

        public java.util.List<Entity> getLeafEntities()
        Description copied from interface: Entity
        Gets the list of non-abstract leaf sub entities.
        If this entity is already non-abstract the list consists of this entity.
        Specified by:
        getLeafEntities in interface Entity
        Returns:
        the leafs
      • collectLeafEntities

        protected void collectLeafEntities​(java.util.List<Entity> leafs,
                                           Entity entity)
        Recursivly collects the leaf childs.
        Parameters:
        leafs - the list if leafs
        entity - the current entity to analyze
      • collectSubEntities

        protected void collectSubEntities​(java.util.List<Entity> subEntities,
                                          Entity entity)
        Recursivly collects all sub entities.
        Parameters:
        subEntities - the list of collected sub entities
        entity - the current entity to analyze
      • getAssociatedEntities

        public java.util.Set<Entity> getAssociatedEntities()
        Description copied from interface: Entity
        Gets a set of all entities that are associated to this entity.
        The kind of association can be a relation, a foreign relation or some hierarchy dependency or a combination of.
        Specified by:
        getAssociatedEntities in interface Entity
        Returns:
        the set of entities including me
      • collectAssociatedEntities

        protected void collectAssociatedEntities​(java.util.Set<Entity> associates,
                                                 Entity entity,
                                                 java.util.Set<Entity> processedEntities)
        Recursively collects the associated entities for a given entity.
        Parameters:
        associates - the set of associated entities so far
        entity - the current entity to analyze
        processedEntities - the already processed entities (to avoid loops)
      • setIntegrity

        public void setIntegrity​(Integrity integrity)
        Sets the integrity.
        Parameters:
        integrity - the integrity
      • setInheritanceType

        public void setInheritanceType​(InheritanceType inheritanceType)
        Sets the inheritance type.
        Parameters:
        inheritanceType - the inheritance type
      • setSuperEntityName

        public void setSuperEntityName​(java.lang.String superEntityName)
        Sets the name of the super entity.
        Parameters:
        superEntityName - the super entity
      • setSuperEntity

        public void setSuperEntity​(Entity superEntity)
        Sets the super entity.
        Parameters:
        superEntity - the super entity
      • setContextIdAttribute

        public void setContextIdAttribute​(Attribute contextIdAttribute)
        Sets the context id attribute.
        Parameters:
        contextIdAttribute - the attribute providing the context ID
      • setSorting

        public void setSorting​(java.util.List<AttributeSorting> sorting)
        Sets the default sorting.
        Parameters:
        sorting - the sorting, null if none
      • getAttributes

        public java.util.List<Attribute> getAttributes()
        Description copied from interface: Entity
        Gets the attributes.
        Specified by:
        getAttributes in interface Entity
        Returns:
        the attributes
      • isRootEntityAccordingToModel

        public boolean isRootEntityAccordingToModel()
        Returns whether this entity is a root-entity according to model.
        Specified by:
        isRootEntityAccordingToModel in interface Entity
        Returns:
        true if root entity
      • setRootEntityAccordingToModel

        public void setRootEntityAccordingToModel​(boolean modelRoot)
        Sets whether this entity is a root-entity according to model.
        Parameters:
        modelRoot - true if root entity
      • isProvidingRootClassIdAccordingToModel

        public boolean isProvidingRootClassIdAccordingToModel()
        Returns whether this entity should provide a root class id according to model.
        Specified by:
        isProvidingRootClassIdAccordingToModel in interface Entity
        Returns:
        true if should provide a root class id
      • setProvidingRootClassIdAccordingToModel

        public void setProvidingRootClassIdAccordingToModel​(boolean modelRootClassId)
        Sets whether this entity should provide a root class id according to model.
        Parameters:
        modelRootClassId - true if should provide a root class id
      • isProvidingRootIdAccordingToModel

        public boolean isProvidingRootIdAccordingToModel()
        Returns whether this entity should provide a root id according to model.
        Specified by:
        isProvidingRootIdAccordingToModel in interface Entity
        Returns:
        true if should provide a root id
      • setProvidingRootIdAccordingToModel

        public void setProvidingRootIdAccordingToModel​(boolean modelRootId)
        Sets whether this entity should provide a root id according to model.
        Parameters:
        modelRootId - true if should provide a root id
      • getInheritedAttributes

        public java.util.List<Attribute> getInheritedAttributes()
        Description copied from interface: Entity
        Gets the inherited attributes.
        Specified by:
        getInheritedAttributes in interface Entity
        Returns:
        the attributes
      • getSubEntityAttributes

        public java.util.List<Attribute> getSubEntityAttributes()
        Description copied from interface: Entity
        Gets the attributes from the sub entities.
        Specified by:
        getSubEntityAttributes in interface Entity
        Returns:
        the attributes
      • getAttributesIncludingInherited

        public java.util.List<Attribute> getAttributesIncludingInherited()
        Description copied from interface: Entity
        Gets the attributes including the inherited ones.
        Specified by:
        getAttributesIncludingInherited in interface Entity
        Returns:
        the attributes
      • getAttributesIncludingSubEntities

        public java.util.List<Attribute> getAttributesIncludingSubEntities()
        Description copied from interface: Entity
        Gets the attributes including the ones from the sub entities.
        Specified by:
        getAttributesIncludingSubEntities in interface Entity
        Returns:
        the attributes
      • getAllAttributes

        public java.util.List<Attribute> getAllAttributes()
        Description copied from interface: Entity
        Gets all attributes including inherited and from sub entities.
        Specified by:
        getAllAttributes in interface Entity
        Returns:
        the attributes
      • getTableAttributes

        public java.util.List<Attribute> getTableAttributes()
        Description copied from interface: Entity
        Gets the attributes of the table mapped by this entity.
        Specified by:
        getTableAttributes in interface Entity
        Returns:
        the attributes, empty if entity does not map to a table or does not provide attributes
      • getMappedAttributes

        public java.util.List<Attribute> getMappedAttributes()
        Description copied from interface: Entity
        Gets the attributes mapped by the persistence layer for this entity.
        Specified by:
        getMappedAttributes in interface Entity
        Returns:
        the attributes
      • moveIdSerialToEnd

        protected java.util.List<Attribute> moveIdSerialToEnd​(java.util.List<Attribute> attributes)
        Moved id and serial to the end of a new created attribute list.
        Parameters:
        attributes - the attribute list
        Returns:
        the new filtered attribute list
      • removeIdSerial

        protected java.util.List<Attribute> removeIdSerial​(java.util.List<Attribute> attributes)
        Removes id and serial from the list of attributes.
        Parameters:
        attributes - the attribute list
        Returns:
        the new filtered attribute list
      • appendIdSerial

        protected java.util.List<Attribute> appendIdSerial​(Entity entity,
                                                           java.util.List<Attribute> attributes)
        Appends id and serial from another entity.
        Parameters:
        entity - the entity defining id and serial
        attributes - the attribute list
        Returns:
        the new filtered attribute list
      • getInheritedIndexes

        public java.util.List<Index> getInheritedIndexes()
        Description copied from interface: Entity
        Gets inherited indexes.
        Specified by:
        getInheritedIndexes in interface Entity
        Returns:
        the indexes
      • getIndexesIncludingInherited

        public java.util.List<Index> getIndexesIncludingInherited()
        Description copied from interface: Entity
        Gets all including inherited indexes.
        Specified by:
        getIndexesIncludingInherited in interface Entity
        Returns:
        the indexes
      • getSubEntityIndexes

        public java.util.List<Index> getSubEntityIndexes()
        Description copied from interface: Entity
        Gets indexes from sub entities.
        Specified by:
        getSubEntityIndexes in interface Entity
        Returns:
        the indexes
      • getIndexesIncludingSubEntities

        public java.util.List<Index> getIndexesIncludingSubEntities()
        Description copied from interface: Entity
        Gets all including indexes from sub entities.
        Specified by:
        getIndexesIncludingSubEntities in interface Entity
        Returns:
        the indexes
      • getAllIndexes

        public java.util.List<Index> getAllIndexes()
        Description copied from interface: Entity
        Gets all including inherited and indexes from sub entities.
        Specified by:
        getAllIndexes in interface Entity
        Returns:
        the indexes
      • getTableIndexes

        public java.util.List<Index> getTableIndexes()
        Description copied from interface: Entity
        Gets the indexes of the table mapped by this entity.
        Specified by:
        getTableIndexes in interface Entity
        Returns:
        the indexes, empty if entity does not map to a table or provides no indexes
      • getInheritedRelations

        public java.util.List<Relation> getInheritedRelations()
        Description copied from interface: Entity
        Gets the inherited relations.
        Specified by:
        getInheritedRelations in interface Entity
        Returns:
        the relations
      • getSubEntityRelations

        public java.util.List<Relation> getSubEntityRelations()
        Description copied from interface: Entity
        Gets the relations from the sub entities.
        Specified by:
        getSubEntityRelations in interface Entity
        Returns:
        the relations
      • getRelationsIncludingInherited

        public java.util.List<Relation> getRelationsIncludingInherited()
        Description copied from interface: Entity
        Gets all including inherited relations.
        Specified by:
        getRelationsIncludingInherited in interface Entity
        Returns:
        the relations
      • getRelationsIncludingSubEntities

        public java.util.List<Relation> getRelationsIncludingSubEntities()
        Description copied from interface: Entity
        Gets all relations including the ones from the sub entities.
        Specified by:
        getRelationsIncludingSubEntities in interface Entity
        Returns:
        the relations
      • getAllRelations

        public java.util.List<Relation> getAllRelations()
        Description copied from interface: Entity
        Gets all relations including the inherited and the ones from the sub entities.
        Specified by:
        getAllRelations in interface Entity
        Returns:
        the relations
      • getTableRelations

        public java.util.List<Relation> getTableRelations()
        Description copied from interface: Entity
        Gets the relations of the table mapped by this entity.
        Specified by:
        getTableRelations in interface Entity
        Returns:
        the relations, empty if entity does not map to a table or provides no relations
      • getCompositePaths

        public java.util.Set<java.util.List<Relation>> getCompositePaths()
        Description copied from interface: Entity
        Gets the paths of composite relations to this entity.
        Notice that this inludes paths to sub-entities as well.
        Specified by:
        getCompositePaths in interface Entity
        Returns:
        the paths, empty list if this is not a component of any other entity
      • getAllCompositePaths

        public java.util.Set<java.util.List<Relation>> getAllCompositePaths()
        Description copied from interface: Entity
        Gets the paths of composite relations to this entity.
        Notice that this inludes paths to sub-entities and super-entities as well.
        Specified by:
        getAllCompositePaths in interface Entity
        Returns:
        the paths, empty list if this is not a component of any other entity
      • getComponents

        public java.util.Set<Entity> getComponents()
        Description copied from interface: Entity
        Gets the direct components of this entity.
        Specified by:
        getComponents in interface Entity
        Returns:
        the components
      • getComponentsIncludingInherited

        public java.util.Set<Entity> getComponentsIncludingInherited()
        Description copied from interface: Entity
        Gets the direct and inherited components of this entity.
        Specified by:
        getComponentsIncludingInherited in interface Entity
        Returns:
        the components
      • getAllComponents

        public java.util.Set<Entity> getAllComponents()
        Description copied from interface: Entity
        Gets all direct and indirect components of this entity.
        Specified by:
        getAllComponents in interface Entity
        Returns:
        the components
      • isDeeplyReferenced

        public boolean isDeeplyReferenced()
        Description copied from interface: Entity
        Returns whether this entity or one of its components is deeply referenced.
        Specified by:
        isDeeplyReferenced in interface Entity
        Returns:
        true if deeply referenced, false if not
      • setDeeplyReferenced

        public void setDeeplyReferenced​(boolean deeplyReferenced)
      • getDeepReferences

        public java.util.List<Relation> getDeepReferences()
        Description copied from interface: Entity
        Gets the deep references to this entity.
        Specified by:
        getDeepReferences in interface Entity
        Returns:
        the deep references, empty if no deep references
      • getDeepReferencesToComponents

        public java.util.List<Relation> getDeepReferencesToComponents()
        Description copied from interface: Entity
        Gets the deep references to components of this root entity.
        Will contain all deep references to all components, not only the direct childs.
        Specified by:
        getDeepReferencesToComponents in interface Entity
        Returns:
        the deep references, empty if this is not a root entity or there are no deep references
      • getDeeplyReferencedComponents

        public java.util.List<Relation> getDeeplyReferencedComponents()
        Description copied from interface: Entity
        Gets the deeply referenced components.
        Will contain the relations to components where Entity.isDeeplyReferenced() is true.
        Specified by:
        getDeeplyReferencedComponents in interface Entity
        Returns:
        the composite relations deeply referenced
      • getAttributeByJavaName

        public Attribute getAttributeByJavaName​(java.lang.String javaName,
                                                boolean all)
        Description copied from interface: Entity
        Gets an attribute by its java name.
        Specified by:
        getAttributeByJavaName in interface Entity
        Parameters:
        javaName - the java name
        all - true if include inherited attributes
        Returns:
        the attribute, null if no such attribute
      • getAttributeByColumnName

        public Attribute getAttributeByColumnName​(java.lang.String columnName,
                                                  boolean all)
        Description copied from interface: Entity
        Gets an attribute by its database column name.

        Notice that upper/lowercase doesnt matter.

        Specified by:
        getAttributeByColumnName in interface Entity
        Parameters:
        columnName - the database column name
        all - true if include inherited attributes
        Returns:
        the attribute, null if no such attribute
      • getContextIdAttribute

        public Attribute getContextIdAttribute()
        Description copied from interface: Entity
        Gets the attribute that holds the context id.
        Specified by:
        getContextIdAttribute in interface Entity
        Returns:
        the context attribute, null if none
      • getUniqueDomainKey

        public java.util.List<Attribute> getUniqueDomainKey()
        Description copied from interface: Entity
        Gets the attributes describing the unique domain key.
        Specified by:
        getUniqueDomainKey in interface Entity
        Returns:
        the udk attributes, empty if no udk
      • getUniqueDomainKeyImpl

        protected void getUniqueDomainKeyImpl​(java.util.List<Attribute> uniqueDomainKeys,
                                              Entity entity)
        Adds the unique domain keys recursively for given entity to the list.
        Parameters:
        uniqueDomainKeys - the unique domain key attributes
        entity - the entity to inspect
      • getSorting

        public java.util.List<AttributeSorting> getSorting()
        Description copied from interface: Entity
        Gets the default sorting for this entity.
        Specified by:
        getSorting in interface Entity
        Returns:
        the sorting, null if unsorted by default
      • getIndexes

        public java.util.List<Index> getIndexes()
        Description copied from interface: Entity
        Gets the indexes.
        Specified by:
        getIndexes in interface Entity
        Returns:
        the indexes
      • getIndex

        public Index getIndex​(java.lang.String name,
                              boolean all)
        Description copied from interface: Entity
        Gets an index by its name.
        Specified by:
        getIndex in interface Entity
        Parameters:
        name - the index name
        all - true if include inherited indexes
        Returns:
        the index, null if no such index
      • getRelations

        public java.util.List<Relation> getRelations()
        Description copied from interface: Entity
        Gets the relations.
        Specified by:
        getRelations in interface Entity
        Returns:
        the relations
      • getReferencingRelations

        public java.util.List<Relation> getReferencingRelations()
        Description copied from interface: Entity
        Gets the relations from other entities directly referencing this entity.
        Specified by:
        getReferencingRelations in interface Entity
        Returns:
        the relations
      • getInheritedReferencingRelations

        public java.util.List<Relation> getInheritedReferencingRelations()
        Description copied from interface: Entity
        Gets the relations from other entities referencing any super-entity.
        Specified by:
        getInheritedReferencingRelations in interface Entity
        Returns:
        the relations
      • getReferencingRelationsIncludingInherited

        public java.util.List<Relation> getReferencingRelationsIncludingInherited()
        Description copied from interface: Entity
        Gets the relations from other entities referencing this entity or any super-entity.
        Specified by:
        getReferencingRelationsIncludingInherited in interface Entity
        Returns:
        the relations
      • getSubEntityReferencingRelations

        public java.util.List<Relation> getSubEntityReferencingRelations()
        Description copied from interface: Entity
        Gets the relations from other entities referencing any sub-entity.
        Specified by:
        getSubEntityReferencingRelations in interface Entity
        Returns:
        the relations
      • getReferencingRelationsIncludingSubEntities

        public java.util.List<Relation> getReferencingRelationsIncludingSubEntities()
        Description copied from interface: Entity
        Gets the relations from other entities referencing this entity or any sub-entity.
        Specified by:
        getReferencingRelationsIncludingSubEntities in interface Entity
        Returns:
        the relations
      • getAllReferencingRelations

        public java.util.List<Relation> getAllReferencingRelations()
        Description copied from interface: Entity
        Gets the relations from other entities referencing this entity or any sub-entity or super entity.
        Specified by:
        getAllReferencingRelations in interface Entity
        Returns:
        the relations
      • getRelation

        public Relation getRelation​(java.lang.String name,
                                    boolean all)
        Description copied from interface: Entity
        Gets a relation by its name.
        Specified by:
        getRelation in interface Entity
        Parameters:
        name - the relation's name
        all - true if include inherited relations
        Returns:
        the relation, null if no such relation
      • getRelations

        public java.util.List<Relation> getRelations​(Entity entity,
                                                     boolean all)
        Description copied from interface: Entity
        Gets all relations for a given entity type.
        Specified by:
        getRelations in interface Entity
        Parameters:
        entity - the entity
        all - true if include inherited relations
        Returns:
        the relations, empty if no such relation
      • validate

        public void validate()
                      throws ModelException
        Validates the entity without relation dependent settings.
        Throws:
        ModelException - if validation failed
      • sqlCreateTable

        public java.lang.String sqlCreateTable​(org.tentackle.sql.Backend backend)
                                        throws ModelException
        Description copied from interface: Entity
        Creates the table creation sql code.
        Specified by:
        sqlCreateTable in interface Entity
        Parameters:
        backend - the backend to create sql code for
        Returns:
        the SQL code
        Throws:
        ModelException - if model inconsistent
      • isComposite

        public boolean isComposite()
        Description copied from interface: Entity
        Returns whether entity has composite relations.
        Specified by:
        isComposite in interface Entity
        Returns:
        true if composite entity
      • isAbstract

        public boolean isAbstract()
        Description copied from interface: Entity
        Returns whether class may be instantiated.
        Specified by:
        isAbstract in interface Entity
        Returns:
        true if class is abstract
      • isTracked

        public boolean isTracked()
        Description copied from interface: Entity
        Returns whether entity is tracked.
        Specified by:
        isTracked in interface Entity
        Returns:
        true if tracked
      • isDeletionCascaded

        public java.lang.Boolean isDeletionCascaded()
        Description copied from interface: Entity
        Returns the cascade-flag if it is the same for all composite relations.
        If there are no composite relations at all, false is returned.
        Specified by:
        isDeletionCascaded in interface Entity
        Returns:
        the cascade flag, null if mixed composite relations
      • isRootOfInheritanceHierarchy

        public boolean isRootOfInheritanceHierarchy()
        Description copied from interface: Entity
        Returns whether entity is the root of an inheritance hierarchy.
        Specified by:
        isRootOfInheritanceHierarchy in interface Entity
        Returns:
        true if root
      • getRootAttributes

        public java.util.Set<Attribute> getRootAttributes()
        Description copied from interface: Entity
        Returns the attributes that corresponds to the root id.
        Specified by:
        getRootAttributes in interface Entity
        Returns:
        the attributes, empty list if root id is provided separately or no root id at all
      • getRootAttribute

        public Attribute getRootAttribute()
        Description copied from interface: Entity
        Returns the single root attribute if there is exactly one.
        Specified by:
        getRootAttribute in interface Entity
        Returns:
        the attribute, null if none or more than one
      • getRootEntities

        public java.util.Set<Entity> getRootEntities()
        Description copied from interface: Entity
        Returns the root entities.
        Returns all roots, even abstract ones.
        Specified by:
        getRootEntities in interface Entity
        Returns:
        the root entities, empty list if rootclassid is provided separately or no rootclassid at all
      • getRootEntity

        public Entity getRootEntity()
        Description copied from interface: Entity
        Returns the single root entity if there is exactly one and it is not abstract.
        Specified by:
        getRootEntity in interface Entity
        Returns:
        the root entity, null if none or abstract or more than one
      • isRootEntity

        public boolean isRootEntity()
        Description copied from interface: Entity
        Returns whether this is a root entity.
        Inspects the super entities as well.
        Specified by:
        isRootEntity in interface Entity
        Returns:
        true if root entity
      • getTableProvidingEntity

        public Entity getTableProvidingEntity()
        Description copied from interface: Entity
        Gets the entity that provides the database table.
        Specified by:
        getTableProvidingEntity in interface Entity
        Returns:
        the table providing entity, null if entity is abstract and does not correspond to a single table
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object