java.lang.Object
org.tentackle.model.impl.EntityImpl
- All Implemented Interfaces:
Comparable<EntityImpl>,Entity,ModelElement
The entity model implementation.
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionEntityImpl(EntityFactoryImpl factory, SourceInfo sourceInfo) Creates an entity. -
Method Summary
Modifier and TypeMethodDescriptionappendIdSerial(Entity entity, List<Attribute> attributes) Appends id and serial from another entity.protected voidRecursively collects the associated entities for a given entity.protected voidcollectLeafEntities(List<Entity> leafs, Entity entity) Recursively collects the leaf children.protected voidcollectSubEntities(List<Entity> subEntities, Entity entity) Recursively collects all sub entities.intbooleanGets all attributes including inherited and from sub entities.Gets all direct and indirect components of this entity.Gets the paths of composite relations to this entity.
Notice that this includes paths to sub-entities and super-entities as well.Gets all including inherited and indexes from sub entities.Gets the relations from other entities referencing this entity or any sub-entity or super entity.Gets all relations including the inherited and the ones from the sub entities.Gets all sub entities.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.getAttributeByColumnName(String columnName, boolean all) Gets an attribute by its database column name.getAttributeByJavaName(String javaName, boolean all) Gets an attribute by its java name.Gets the attributes.Gets the attributes including the inherited ones.Gets the attributes including the ones from the sub entities.intGets 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.Gets the direct components of this entity.Gets the direct and inherited components of this entity.Gets the paths of composite relations to this entity.
Notice that this includes paths to sub-entities as well.Gets the attribute that holds the context id.Gets the deeply referenced components.
Will contain the relations to components whereEntity.isDeeplyReferenced()is true.Gets the deep references to this entity.Gets the deep references to components of this root entity.
Will contain all deep references to all components, not only the direct children.Gets the table alias originally configured in the model.Gets the attributes of embedded entities.getEmbeddedRelations(Entity embeddingEntity) Gets the relations of all embedded entities.
Due to the restriction of embedded entities, these relations are all non-composite object relations.Gets the embedding entities for this embedded entity.Gets the paths of embedding relations to this entity.Gets the inheritance type of the hierarchy.
For leafs, which haveInheritanceType.NONE, the type of the super entity is returned.Gets an index by its name.Gets the indexes.Gets all including inherited indexes.Gets all including indexes from sub entities.getInheritanceChain(Entity childEntity) Gets the inheritance chain from this entity down to given sub entity.Gets the inheritance type.Gets the inherited attributes.Gets inherited indexes.Gets the relations from other entities referencing any super-entity.Gets the inherited relations.Gets the referential integrity mode.Gets the list of non-abstract leaf sub entities.
If this entity is already non-abstract the list consists of this entity.Gets the attributes mapped by the persistence layer for this entity.getName()Gets the name of the element.Gets the options.intGets the ordinal along the inheritance path.Gets the parent element.Gets the relations from other entities directly referencing this entity.Gets the relations from other entities referencing this entity or any super-entity.Gets the relations from other entities referencing this entity or any sub-entity.getRelation(String name, boolean all) Gets a relation by its name.Gets the relations.getRelations(Entity entity, boolean all) Gets all relations for a given entity type.Gets all including inherited relations.Gets all relations including the ones from the sub entities.Returns the single root attribute if there is exactly one.Returns the attributes that corresponds to the root id.Returns the root entities.
Returns all roots, even abstract ones.Returns the single root entity, if there is exactly one, and it is not abstract.Gets the schema name.Gets the default sorting for this entity.Gets the information about the source where this element is defined.Gets the direct sub entities.Gets the attributes from the sub entities.Gets indexes from sub entities.Gets the relations from other entities referencing any sub-entity.Gets the relations from the sub entities.Gets all super entities.Gets the super class entity if inherited.Gets the name of the super class entity.Gets the table alias for joined selects.
The alias is unique among all tables.Gets the attributes of the table mapped by this entity.Gets the indexes of the table mapped by this entity.Gets the database table name.
An optional schema may be prepended separated by a dot.Gets the tablename without the leading schema.Gets the entity that provides the database table.Gets the relations of the table mapped by this entity.
Will also contain the relations from embedded entities.Gets the top most entity of the inheritance tree.
Returns this entity if there is no inheritance.Gets the attributes describing the unique domain key.protected voidgetUniqueDomainKeyImpl(List<Attribute> uniqueDomainKeys, Entity entity) Adds the unique domain keys recursively for given entity to the list.inthashCode()booleanReturns whether class may be instantiated.booleanReturns whether entity has composite relations.booleanReturns whether this entity or one of its components is deeply referenced.Returns the cascade-flag if it is the same for all composite relations.
If there are no composite relations at all, false is returned.booleanReturns whether entity has composite non-embedded relations.booleanReturns whether this is an embedded entity.
Such entities are embedded via embedding relations.booleanReturns whether this entity should provide a root class id according to model.booleanReturns whether this entity should provide a root id according to model.booleanReturns whether this is a root entity.
Inspects the super entities as well.booleanReturns whether this entity is a root-entity according to model.booleanReturns whether entity is the root of an inheritance hierarchy.booleanReturns whether entity is tracked.moveIdSerialToEnd(List<Attribute> attributes) Moved id and serial to the end of a new created attribute list.booleanParses a configuration line.removeIdSerial(List<Attribute> attributes) Removes id and serial from the list of attributes.voidsetClassId(int classId) Sets the entity id.voidsetContextIdAttribute(Attribute contextIdAttribute) Sets the context id attribute.voidsetDeeplyReferenced(boolean deeplyReferenced) voidsetDefinedTableAlias(String definedTableAlias) Sets the table alias defined by the model specification.voidsetInheritanceType(InheritanceType inheritanceType) Sets the inheritance type.voidsetIntegrity(Integrity integrity) Sets the integrity.voidSets the entity's name.voidsetOrdinal(int ordinal) voidsetProvidingRootClassIdAccordingToModel(boolean modelRootClassId) Sets whether this entity should provide a root class id according to model.voidsetProvidingRootIdAccordingToModel(boolean modelRootId) Sets whether this entity should provide a root id according to model.voidsetRootEntityAccordingToModel(boolean modelRoot) Sets whether this entity is a root-entity according to model.voidsetSorting(List<AttributeSorting> sorting) Sets the default sorting.voidsetSuperEntity(Entity superEntity) Sets the super entity.voidsetSuperEntityName(String superEntityName) Sets the name of the super entity.voidsetTableAlias(String tableAlias) Sets the table alias.voidsetTableName(String tableName) Sets the tablename.sqlCreateTable(Backend backend) Creates the table creation sql code.toString()voidvalidate()Validates the entity without relation dependent settings.voidValidates the relation dependent settings.
AssumesModelImpl.updateRelations()applied successfully.
-
Constructor Details
-
EntityImpl
Creates an entity.- Parameters:
factory- the factory to create entity optionssourceInfo- the source information
-
-
Method Details
-
getSourceInfo
Description copied from interface:ModelElementGets the information about the source where this element is defined.- Specified by:
getSourceInfoin interfaceModelElement- Returns:
- the source info
-
getParent
Description copied from interface:ModelElementGets the parent element.- Specified by:
getParentin interfaceModelElement- Returns:
- the parent, null if none
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<EntityImpl>
-
parseConfiguration
Parses a configuration line.- Parameters:
line- the configuration line- Returns:
- true if known configuration processed
- Throws:
ModelException- if parsing failed
-
getName
Description copied from interface:ModelElementGets the name of the element.- Specified by:
getNamein interfaceModelElement- Returns:
- the name
-
setName
Sets the entity's name.- Parameters:
name- the name
-
getOrdinal
public int getOrdinal()Description copied from interface:ModelElementGets the ordinal along the inheritance path.- Specified by:
getOrdinalin interfaceModelElement- Returns:
- the ordinal, starting at 0
-
setOrdinal
public void setOrdinal(int ordinal) -
getClassId
public int getClassId()Description copied from interface:EntityGets 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:
getClassIdin interfaceEntity- Returns:
- the entity class id
-
setClassId
public void setClassId(int classId) Sets the entity id.- Parameters:
classId- the id
-
getTableName
Description copied from interface:EntityGets 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:
getTableNamein interfaceEntity- Returns:
- the tablename (always in lowercase), null if entity doesn't map to its own table
-
getSchemaName
Description copied from interface:EntityGets the schema name.- Specified by:
getSchemaNamein interfaceEntity- Returns:
- the schema (always in lowercase), null if default
-
getTableNameWithoutSchema
Description copied from interface:EntityGets 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:
getTableNameWithoutSchemain interfaceEntity- Returns:
- the tablename relative to its schema (always in lowercase), null if entity doesn't map to its own table
-
getTableAlias
Description copied from interface:EntityGets 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:
getTableAliasin interfaceEntity- Returns:
- the table alias
-
getDefinedTableAlias
Description copied from interface:EntityGets the table alias originally configured in the model.- Specified by:
getDefinedTableAliasin interfaceEntity- Returns:
- the fixed alias, null if automatic
-
setTableName
Sets the tablename.- Parameters:
tableName- the tablename
-
setTableAlias
Sets the table alias.- Parameters:
tableAlias- the alias
-
setDefinedTableAlias
Sets the table alias defined by the model specification.- Parameters:
definedTableAlias- the original alias, null if automatic
-
getIntegrity
Description copied from interface:EntityGets the referential integrity mode.- Specified by:
getIntegrityin interfaceEntity- Returns:
- the integrity mode
-
getInheritanceType
Description copied from interface:EntityGets the inheritance type.- Specified by:
getInheritanceTypein interfaceEntity- Returns:
- the inheritance type
-
getHierarchyInheritanceType
Description copied from interface:EntityGets the inheritance type of the hierarchy.
For leafs, which haveInheritanceType.NONE, the type of the super entity is returned.- Specified by:
getHierarchyInheritanceTypein interfaceEntity- Returns:
- the effective inheritance type
-
getSuperEntityName
Description copied from interface:EntityGets the name of the super class entity.- Specified by:
getSuperEntityNamein interfaceEntity- Returns:
- the super class name, null if not inherited
-
getSuperEntity
Description copied from interface:EntityGets the super class entity if inherited.- Specified by:
getSuperEntityin interfaceEntity- Returns:
- the super entity, null if not inherited
-
getSuperEntities
Description copied from interface:EntityGets all super entities.- Specified by:
getSuperEntitiesin interfaceEntity- Returns:
- the path along up to the top super entity.
-
getTopSuperEntity
Description copied from interface:EntityGets the top most entity of the inheritance tree.
Returns this entity if there is no inheritance.- Specified by:
getTopSuperEntityin interfaceEntity- Returns:
- the root of the inheritance hierarchy
-
getInheritanceChain
Description copied from interface:EntityGets the inheritance chain from this entity down to given sub entity.- Specified by:
getInheritanceChainin interfaceEntity- 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
Description copied from interface:EntityGets the direct sub entities.- Specified by:
getSubEntitiesin interfaceEntity- Returns:
- the sub entities, empty list if no sub entities
-
getAllSubEntities
Description copied from interface:EntityGets all sub entities.- Specified by:
getAllSubEntitiesin interfaceEntity- Returns:
- the sub entities, empty list if no sub entities
-
getLeafEntities
Description copied from interface:EntityGets the list of non-abstract leaf sub entities.
If this entity is already non-abstract the list consists of this entity.- Specified by:
getLeafEntitiesin interfaceEntity- Returns:
- the leafs
-
collectLeafEntities
Recursively collects the leaf children.- Parameters:
leafs- the list if leafsentity- the current entity to analyze
-
collectSubEntities
Recursively collects all sub entities.- Parameters:
subEntities- the list of collected sub entitiesentity- the current entity to analyze
-
getAssociatedEntities
Description copied from interface:EntityGets 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:
getAssociatedEntitiesin interfaceEntity- Returns:
- the set of entities including me
-
collectAssociatedEntities
protected void collectAssociatedEntities(Set<Entity> associates, Entity entity, Set<Entity> processedEntities) Recursively collects the associated entities for a given entity.- Parameters:
associates- the set of associated entities so farentity- the current entity to analyzeprocessedEntities- the already processed entities (to avoid loops)
-
setIntegrity
Sets the integrity.- Parameters:
integrity- the integrity
-
setInheritanceType
Sets the inheritance type.- Parameters:
inheritanceType- the inheritance type
-
setSuperEntityName
Sets the name of the super entity.- Parameters:
superEntityName- the super entity
-
setSuperEntity
Sets the super entity.- Parameters:
superEntity- the super entity
-
setContextIdAttribute
Sets the context id attribute.- Parameters:
contextIdAttribute- the attribute providing the context ID
-
setSorting
Sets the default sorting.- Parameters:
sorting- the sorting, null if none
-
getOptions
Description copied from interface:EntityGets the options.- Specified by:
getOptionsin interfaceEntity- Returns:
- the options
-
getAttributes
Description copied from interface:EntityGets the attributes.- Specified by:
getAttributesin interfaceEntity- Returns:
- the attributes
-
isRootEntityAccordingToModel
public boolean isRootEntityAccordingToModel()Returns whether this entity is a root-entity according to model.- Specified by:
isRootEntityAccordingToModelin interfaceEntity- 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:
isProvidingRootClassIdAccordingToModelin interfaceEntity- 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:
isProvidingRootIdAccordingToModelin interfaceEntity- Returns:
- true if the entity 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 the entity should provide a root id
-
getInheritedAttributes
Description copied from interface:EntityGets the inherited attributes.- Specified by:
getInheritedAttributesin interfaceEntity- Returns:
- the attributes
- Throws:
ModelException
-
getEmbeddedAttributes
Description copied from interface:EntityGets the attributes of embedded entities.- Specified by:
getEmbeddedAttributesin interfaceEntity- Returns:
- the embedded attributes
- Throws:
ModelException
-
getEmbeddedRelations
Description copied from interface:EntityGets the relations of all embedded entities.
Due to the restriction of embedded entities, these relations are all non-composite object relations.- Specified by:
getEmbeddedRelationsin interfaceEntity- Parameters:
embeddingEntity- the effectively embedding entity- Returns:
- the list of embedded relations
- Throws:
ModelException- if failed
-
getSubEntityAttributes
Description copied from interface:EntityGets the attributes from the sub entities.- Specified by:
getSubEntityAttributesin interfaceEntity- Returns:
- the attributes
-
getAttributesIncludingInherited
Description copied from interface:EntityGets the attributes including the inherited ones.- Specified by:
getAttributesIncludingInheritedin interfaceEntity- Returns:
- the attributes
- Throws:
ModelException
-
getAttributesIncludingSubEntities
Description copied from interface:EntityGets the attributes including the ones from the sub entities.- Specified by:
getAttributesIncludingSubEntitiesin interfaceEntity- Returns:
- the attributes
-
getAllAttributes
Description copied from interface:EntityGets all attributes including inherited and from sub entities.- Specified by:
getAllAttributesin interfaceEntity- Returns:
- the attributes
- Throws:
ModelException
-
getTableAttributes
Description copied from interface:EntityGets the attributes of the table mapped by this entity.- Specified by:
getTableAttributesin interfaceEntity- Returns:
- the attributes, empty if entity does not map to a table or does not provide attributes
- Throws:
ModelException
-
getMappedAttributes
Description copied from interface:EntityGets the attributes mapped by the persistence layer for this entity.- Specified by:
getMappedAttributesin interfaceEntity- Returns:
- the attributes
- Throws:
ModelException
-
moveIdSerialToEnd
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
Removes id and serial from the list of attributes.- Parameters:
attributes- the attribute list- Returns:
- the new filtered attribute list
-
appendIdSerial
Appends id and serial from another entity.- Parameters:
entity- the entity defining id and serialattributes- the attribute list- Returns:
- the new filtered attribute list
-
getInheritedIndexes
Description copied from interface:EntityGets inherited indexes.- Specified by:
getInheritedIndexesin interfaceEntity- Returns:
- the indexes
-
getIndexesIncludingInherited
Description copied from interface:EntityGets all including inherited indexes.- Specified by:
getIndexesIncludingInheritedin interfaceEntity- Returns:
- the indexes
-
getSubEntityIndexes
Description copied from interface:EntityGets indexes from sub entities.- Specified by:
getSubEntityIndexesin interfaceEntity- Returns:
- the indexes
-
getIndexesIncludingSubEntities
Description copied from interface:EntityGets all including indexes from sub entities.- Specified by:
getIndexesIncludingSubEntitiesin interfaceEntity- Returns:
- the indexes
-
getAllIndexes
Description copied from interface:EntityGets all including inherited and indexes from sub entities.- Specified by:
getAllIndexesin interfaceEntity- Returns:
- the indexes
-
getTableIndexes
Description copied from interface:EntityGets the indexes of the table mapped by this entity.- Specified by:
getTableIndexesin interfaceEntity- Returns:
- the indexes, empty if entity does not map to a table or provides no indexes
-
getInheritedRelations
Description copied from interface:EntityGets the inherited relations.- Specified by:
getInheritedRelationsin interfaceEntity- Returns:
- the relations
- Throws:
ModelException
-
getSubEntityRelations
Description copied from interface:EntityGets the relations from the sub entities.- Specified by:
getSubEntityRelationsin interfaceEntity- Returns:
- the relations
-
getRelationsIncludingInherited
Description copied from interface:EntityGets all including inherited relations.- Specified by:
getRelationsIncludingInheritedin interfaceEntity- Returns:
- the relations
- Throws:
ModelException
-
getRelationsIncludingSubEntities
Description copied from interface:EntityGets all relations including the ones from the sub entities.- Specified by:
getRelationsIncludingSubEntitiesin interfaceEntity- Returns:
- the relations
-
getAllRelations
Description copied from interface:EntityGets all relations including the inherited and the ones from the sub entities.- Specified by:
getAllRelationsin interfaceEntity- Returns:
- the relations
- Throws:
ModelException
-
getTableRelations
Description copied from interface:EntityGets the relations of the table mapped by this entity.
Will also contain the relations from embedded entities.- Specified by:
getTableRelationsin interfaceEntity- Returns:
- the relations, empty if entity does not map to a table or provides no relations
- Throws:
ModelException
-
getCompositePaths
Description copied from interface:EntityGets the paths of composite relations to this entity.
Notice that this includes paths to sub-entities as well.- Specified by:
getCompositePathsin interfaceEntity- Returns:
- the paths, empty list if this is not a component of any other entity
-
getAllCompositePaths
Description copied from interface:EntityGets the paths of composite relations to this entity.
Notice that this includes paths to sub-entities and super-entities as well.- Specified by:
getAllCompositePathsin interfaceEntity- Returns:
- the paths, empty list if this is not a component of any other entity
-
getEmbeddingPaths
Description copied from interface:EntityGets the paths of embedding relations to this entity.- Specified by:
getEmbeddingPathsin interfaceEntity- Returns:
- the paths, empty list if this is not an embedded entity
-
getEmbeddingEntities
Description copied from interface:EntityGets the embedding entities for this embedded entity.- Specified by:
getEmbeddingEntitiesin interfaceEntity- Returns:
- the embedding entities, empty if this is not an embedded entity
-
getComponents
Description copied from interface:EntityGets the direct components of this entity.- Specified by:
getComponentsin interfaceEntity- Returns:
- the components
-
getComponentsIncludingInherited
Description copied from interface:EntityGets the direct and inherited components of this entity.- Specified by:
getComponentsIncludingInheritedin interfaceEntity- Returns:
- the components
- Throws:
ModelException
-
getAllComponents
Description copied from interface:EntityGets all direct and indirect components of this entity.- Specified by:
getAllComponentsin interfaceEntity- Returns:
- the components
- Throws:
ModelException
-
isDeeplyReferenced
public boolean isDeeplyReferenced()Description copied from interface:EntityReturns whether this entity or one of its components is deeply referenced.- Specified by:
isDeeplyReferencedin interfaceEntity- Returns:
- true if deeply referenced, false if not
-
setDeeplyReferenced
public void setDeeplyReferenced(boolean deeplyReferenced) -
getDeepReferences
Description copied from interface:EntityGets the deep references to this entity.- Specified by:
getDeepReferencesin interfaceEntity- Returns:
- the deep references, empty if no deep references
-
getDeepReferencesToComponents
Description copied from interface:EntityGets the deep references to components of this root entity.
Will contain all deep references to all components, not only the direct children.- Specified by:
getDeepReferencesToComponentsin interfaceEntity- Returns:
- the deep references, empty if this is not a root entity or there are no deep references
-
getDeeplyReferencedComponents
Description copied from interface:EntityGets the deeply referenced components.
Will contain the relations to components whereEntity.isDeeplyReferenced()is true.- Specified by:
getDeeplyReferencedComponentsin interfaceEntity- Returns:
- the composite relations deeply referenced
-
getAttributeByJavaName
Description copied from interface:EntityGets an attribute by its java name.- Specified by:
getAttributeByJavaNamein interfaceEntity- Parameters:
javaName- the java nameall- true if include inherited attributes- Returns:
- the attribute, null if no such attribute
-
getAttributeByColumnName
Description copied from interface:EntityGets an attribute by its database column name.Notice that upper/lowercase doesn't matter.
- Specified by:
getAttributeByColumnNamein interfaceEntity- Parameters:
columnName- the database column nameall- true if include inherited attributes- Returns:
- the attribute, null if no such attribute
-
getContextIdAttribute
Description copied from interface:EntityGets the attribute that holds the context id.- Specified by:
getContextIdAttributein interfaceEntity- Returns:
- the context attribute, null if none
-
getUniqueDomainKey
Description copied from interface:EntityGets the attributes describing the unique domain key.- Specified by:
getUniqueDomainKeyin interfaceEntity- Returns:
- the udk attributes, empty if no udk
- Throws:
ModelException
-
getUniqueDomainKeyImpl
protected void getUniqueDomainKeyImpl(List<Attribute> uniqueDomainKeys, Entity entity) throws ModelException Adds the unique domain keys recursively for given entity to the list.- Parameters:
uniqueDomainKeys- the unique domain key attributesentity- the entity to inspect- Throws:
ModelException
-
getSorting
Description copied from interface:EntityGets the default sorting for this entity.- Specified by:
getSortingin interfaceEntity- Returns:
- the sorting, null if unsorted by default
-
getIndexes
Description copied from interface:EntityGets the indexes.- Specified by:
getIndexesin interfaceEntity- Returns:
- the indexes
-
getIndex
Description copied from interface:EntityGets an index by its name. -
getRelations
Description copied from interface:EntityGets the relations.- Specified by:
getRelationsin interfaceEntity- Returns:
- the relations
-
getReferencingRelations
Description copied from interface:EntityGets the relations from other entities directly referencing this entity.- Specified by:
getReferencingRelationsin interfaceEntity- Returns:
- the relations
-
getInheritedReferencingRelations
Description copied from interface:EntityGets the relations from other entities referencing any super-entity.- Specified by:
getInheritedReferencingRelationsin interfaceEntity- Returns:
- the relations
-
getReferencingRelationsIncludingInherited
Description copied from interface:EntityGets the relations from other entities referencing this entity or any super-entity.- Specified by:
getReferencingRelationsIncludingInheritedin interfaceEntity- Returns:
- the relations
-
getSubEntityReferencingRelations
Description copied from interface:EntityGets the relations from other entities referencing any sub-entity.- Specified by:
getSubEntityReferencingRelationsin interfaceEntity- Returns:
- the relations
-
getReferencingRelationsIncludingSubEntities
Description copied from interface:EntityGets the relations from other entities referencing this entity or any sub-entity.- Specified by:
getReferencingRelationsIncludingSubEntitiesin interfaceEntity- Returns:
- the relations
-
getAllReferencingRelations
Description copied from interface:EntityGets the relations from other entities referencing this entity or any sub-entity or super entity.- Specified by:
getAllReferencingRelationsin interfaceEntity- Returns:
- the relations
-
getRelation
Description copied from interface:EntityGets a relation by its name.- Specified by:
getRelationin interfaceEntity- Parameters:
name- the relation's nameall- true if include inherited relations- Returns:
- the relation, null if no such relation
-
getRelations
Description copied from interface:EntityGets all relations for a given entity type.- Specified by:
getRelationsin interfaceEntity- Parameters:
entity- the entityall- true if include inherited relations- Returns:
- the relations, empty if no such relation
-
validate
Validates the entity without relation dependent settings.- Throws:
ModelException- if validation failed
-
validateRelated
Validates the relation dependent settings.
AssumesModelImpl.updateRelations()applied successfully.- Throws:
ModelException- if validation failed
-
sqlCreateTable
Description copied from interface:EntityCreates the table creation sql code.- Specified by:
sqlCreateTablein interfaceEntity- 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:EntityReturns whether entity has composite relations.- Specified by:
isCompositein interfaceEntity- Returns:
- true if composite entity
-
isEffectivelyComposite
public boolean isEffectivelyComposite()Description copied from interface:EntityReturns whether entity has composite non-embedded relations.- Specified by:
isEffectivelyCompositein interfaceEntity- Returns:
- true if not only embedded composite relations
-
isAbstract
public boolean isAbstract()Description copied from interface:EntityReturns whether class may be instantiated.- Specified by:
isAbstractin interfaceEntity- Returns:
- true if class is abstract
-
isEmbedded
public boolean isEmbedded()Description copied from interface:EntityReturns whether this is an embedded entity.
Such entities are embedded via embedding relations. Embedded entities are mapped to their embedding entity, which is always a regular non-embedded entity. Embedded entities can embed other embedded entities, but cannot have regular components. However, embedded entities can have non-composite object relations (1:1).- Specified by:
isEmbeddedin interfaceEntity- Returns:
- true if embedded
- See Also:
-
isTracked
public boolean isTracked()Description copied from interface:EntityReturns whether entity is tracked. -
isDeletionCascaded
Description copied from interface:EntityReturns 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:
isDeletionCascadedin interfaceEntity- Returns:
- the cascade flag, null if mixed composite relations
-
isRootOfInheritanceHierarchy
public boolean isRootOfInheritanceHierarchy()Description copied from interface:EntityReturns whether entity is the root of an inheritance hierarchy.- Specified by:
isRootOfInheritanceHierarchyin interfaceEntity- Returns:
- true if root
-
getRootAttributes
Description copied from interface:EntityReturns the attributes that corresponds to the root id.- Specified by:
getRootAttributesin interfaceEntity- Returns:
- the attributes, empty list if root id is provided separately or no root id at all
-
getRootAttribute
Description copied from interface:EntityReturns the single root attribute if there is exactly one.- Specified by:
getRootAttributein interfaceEntity- Returns:
- the attribute, null if none or more than one
-
getRootEntities
Description copied from interface:EntityReturns the root entities.
Returns all roots, even abstract ones.- Specified by:
getRootEntitiesin interfaceEntity- Returns:
- the root entities, empty list if rootclassid is provided separately or no rootclassid at all
-
getRootEntity
Description copied from interface:EntityReturns the single root entity, if there is exactly one, and it is not abstract.- Specified by:
getRootEntityin interfaceEntity- Returns:
- the root entity, null if none or abstract or more than one
-
isRootEntity
public boolean isRootEntity()Description copied from interface:EntityReturns whether this is a root entity.
Inspects the super entities as well.- Specified by:
isRootEntityin interfaceEntity- Returns:
- true if root entity
-
getTableProvidingEntity
Description copied from interface:EntityGets the entity that provides the database table.- Specified by:
getTableProvidingEntityin interfaceEntity- Returns:
- the table providing entity, null if entity is abstract and does not correspond to a single table
-
toString
-