public interface Entity extends ModelElement
This is the top-level model element.
| Modifier and Type | Method and Description |
|---|---|
List<Attribute> |
getAllAttributes()
Gets all attributes including inherited and from sub entities.
|
Set<Entity> |
getAllComponents()
Gets all direct and indirect components of this entity.
|
Set<List<Relation>> |
getAllCompositePaths()
Gets the paths of composite relations to this entity.
Notice that this inludes paths to sub-entities and super-entities as well. |
List<Index> |
getAllIndexes()
Gets all including inherited and indexes from sub entities.
|
List<Relation> |
getAllReferencingRelations()
Gets the relations from other entities referencing this entity or any sub-entity or super entity.
|
List<Relation> |
getAllRelations()
Gets all relations including the inherited and the ones from the sub entities.
|
List<Entity> |
getAllSubEntities()
Gets all sub entities.
|
Set<Entity> |
getAssociatedEntities()
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. |
Attribute |
getAttributeByColumnName(String columnName,
boolean all)
Gets an attribute by its database column name.
|
Attribute |
getAttributeByJavaName(String javaName,
boolean all)
Gets an attribute by its java name.
|
List<Attribute> |
getAttributes()
Gets the attributes.
|
List<Attribute> |
getAttributesIncludingInherited()
Gets the attributes including the inherited ones.
|
List<Attribute> |
getAttributesIncludingSubEntities()
Gets the attributes including the ones from the sub entities.
|
int |
getClassId()
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. |
Set<Entity> |
getComponents()
Gets the direct components of this entity.
|
Set<Entity> |
getComponentsIncludingInherited()
Gets the direct and inherited components of this entity.
|
Set<List<Relation>> |
getCompositePaths()
Gets the paths of composite relations to this entity.
Notice that this inludes paths to sub-entities as well. |
Attribute |
getContextIdAttribute()
Gets the attribute that holds the context id.
|
List<Relation> |
getDeeplyReferencedComponents()
Gets the deeply referenced components.
Will contain the relations to components where isDeeplyReferenced() is true. |
List<Relation> |
getDeepReferences()
Gets the deep references to this entity.
|
List<Relation> |
getDeepReferencesToComponents()
Gets the deep references to components of this root entity.
Will contain all deep references to all components, not only the direct childs. |
String |
getDefinedTableAlias()
Gets the table alias originally configured in the model.
|
InheritanceType |
getHierarchyInheritanceType()
Gets the inheritance type of the hierarchy.
For leafs, which have InheritanceType.NONE, the type of the super entity is returned. |
Index |
getIndex(String name,
boolean all)
Gets an index by its name.
|
List<Index> |
getIndexes()
Gets the indexes.
|
List<Index> |
getIndexesIncludingInherited()
Gets all including inherited indexes.
|
List<Index> |
getIndexesIncludingSubEntities()
Gets all including indexes from sub entities.
|
List<Entity> |
getInheritanceChain(Entity subEntity)
Gets the inheritance chain from this entity down to given sub entity.
|
int |
getInheritanceLevel()
Gets the inheritance level if this is a sub entity.
|
InheritanceType |
getInheritanceType()
Gets the inheritance type.
|
List<Attribute> |
getInheritedAttributes()
Gets the inherited attributes.
|
List<Index> |
getInheritedIndexes()
Gets inherited indexes.
|
List<Relation> |
getInheritedReferencingRelations()
Gets the relations from other entities referencing any super-entity.
|
List<Relation> |
getInheritedRelations()
Gets the inherited relations.
|
Integrity |
getIntegrity()
Gets the referential integrity mode.
|
List<Entity> |
getLeafEntities()
Gets the list of non-abstract leaf sub entities.
If this entity is already non-abstract the list consists of this entity. |
List<Attribute> |
getMappedAttributes()
Gets the attributes mapped by the persistence layer for this entity.
|
EntityOptions |
getOptions()
Gets the options.
|
List<Relation> |
getReferencingRelations()
Gets the relations from other entities directly referencing this entity.
|
List<Relation> |
getReferencingRelationsIncludingInherited()
Gets the relations from other entities referencing this entity or any super-entity.
|
List<Relation> |
getReferencingRelationsIncludingSubEntities()
Gets the relations from other entities referencing this entity or any sub-entity.
|
Relation |
getRelation(String name,
boolean all)
Gets a relation by its name.
|
List<Relation> |
getRelations()
Gets the relations.
|
List<Relation> |
getRelations(Entity entity,
boolean all)
Gets all relations for a given entity type.
|
List<Relation> |
getRelationsIncludingInherited()
Gets all including inherited relations.
|
List<Relation> |
getRelationsIncludingSubEntities()
Gets all relations including the ones from the sub entities.
|
Attribute |
getRootAttribute()
Returns the single root attribute if there is exactly one.
|
Set<Attribute> |
getRootAttributes()
Returns the attributes that corresponds to the root id.
|
Set<Entity> |
getRootEntities()
Returns the root entities.
Returns all roots, even abstract ones. |
Entity |
getRootEntity()
Returns the single root entity if there is exactly one and it is not abstract.
|
String |
getSchemaName()
Gets the schema name.
|
List<AttributeSorting> |
getSorting()
Gets the default sorting for this entity.
|
List<Entity> |
getSubEntities()
Gets the direct sub entities.
|
List<Attribute> |
getSubEntityAttributes()
Gets the attributes from the sub entities.
|
List<Index> |
getSubEntityIndexes()
Gets indexes from sub entities.
|
List<Relation> |
getSubEntityReferencingRelations()
Gets the relations from other entities referencing any sub-entity.
|
List<Relation> |
getSubEntityRelations()
Gets the relations from the sub entities.
|
List<Entity> |
getSuperEntities()
Gets all super entities.
|
Entity |
getSuperEntity()
Gets the super class entity if inherited.
|
String |
getSuperEntityName()
Gets the name of the super class entity.
|
String |
getTableAlias()
Gets the table alias for joined selects.
The alias is unique among all tables. |
List<Attribute> |
getTableAttributes()
Gets the attributes of the table mapped by this entity.
|
List<Index> |
getTableIndexes()
Gets the indexes of the table mapped by this entity.
|
String |
getTableName()
Gets the database table name.
An optional schema may be prepended separated by a dot. |
String |
getTableNameWithoutSchema()
Gets the tablename without the leading schema.
|
Entity |
getTableProvidingEntity()
Gets the entity that provides the database table.
|
List<Relation> |
getTableRelations()
Gets the relations of the table mapped by this entity.
|
Entity |
getTopSuperEntity()
Gets the top most entity of the inheritance tree.
Returns this entity if there is no inheritance. |
List<Attribute> |
getUniqueDomainKey()
Gets the attributes describing the unique domain key.
|
boolean |
isAbstract()
Returns whether class may be instantiated.
|
boolean |
isComposite()
Returns whether entity has composite relations.
|
boolean |
isDeeplyReferenced()
Returns whether this entity or one of its components is deeply referenced.
|
Boolean |
isDeletionCascaded()
Returns the cascade-flag if it is the same for all composite relations.
If there are no composite relations at all, false is returned. |
boolean |
isProvidingRootClassIdAccordingToModel()
Returns whether this entity should provide a root class id according to model.
|
boolean |
isProvidingRootIdAccordingToModel()
Returns whether this entity should provide a root id according to model.
|
boolean |
isRootEntity()
Returns whether this is a root entity.
Inspects the super entities as well. |
boolean |
isRootEntityAccordingToModel()
Returns whether this entity is a root-entity according to model.
|
boolean |
isRootOfInheritanceHierarchy()
Returns whether entity is the root of an inheritance hierarchy.
|
boolean |
isTracked()
Returns whether entity is tracked.
|
String |
sqlCreateTable(Backend backend)
Creates the table creation sql code.
|
getName, getParent, getSourceInfoint getClassId()
String getTableName()
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.
String getSchemaName()
String getTableNameWithoutSchema()
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.
String getTableAlias()
String getDefinedTableAlias()
Integrity getIntegrity()
EntityOptions getOptions()
List<Attribute> getInheritedAttributes()
List<Attribute> getSubEntityAttributes()
List<Attribute> getAttributesIncludingInherited()
List<Attribute> getAttributesIncludingSubEntities()
List<Attribute> getAllAttributes()
List<Attribute> getTableAttributes()
List<Attribute> getMappedAttributes()
Attribute getAttributeByJavaName(String javaName, boolean all)
javaName - the java nameall - true if include inherited attributesAttribute getAttributeByColumnName(String columnName, boolean all)
Notice that upper/lowercase doesnt matter.
columnName - the database column nameall - true if include inherited attributesAttribute getContextIdAttribute()
List<Attribute> getUniqueDomainKey()
List<AttributeSorting> getSorting()
List<Relation> getInheritedRelations()
List<Relation> getSubEntityRelations()
List<Relation> getRelationsIncludingInherited()
List<Relation> getRelationsIncludingSubEntities()
List<Relation> getAllRelations()
List<Relation> getTableRelations()
Relation getRelation(String name, boolean all)
name - the relation's nameall - true if include inherited relationsList<Relation> getRelations(Entity entity, boolean all)
entity - the entityall - true if include inherited relationsList<Relation> getReferencingRelations()
List<Relation> getInheritedReferencingRelations()
List<Relation> getSubEntityReferencingRelations()
List<Relation> getReferencingRelationsIncludingInherited()
List<Relation> getReferencingRelationsIncludingSubEntities()
List<Relation> getAllReferencingRelations()
List<Index> getSubEntityIndexes()
List<Index> getIndexesIncludingInherited()
List<Index> getIndexesIncludingSubEntities()
List<Index> getAllIndexes()
List<Index> getTableIndexes()
Index getIndex(String name, boolean all)
name - the index nameall - true if include inherited indexesString sqlCreateTable(Backend backend) throws ModelException
backend - the backend to create sql code forModelException - if model inconsistentboolean isComposite()
boolean isAbstract()
boolean isTracked()
Boolean isDeletionCascaded()
Set<Attribute> getRootAttributes()
Attribute getRootAttribute()
Set<Entity> getRootEntities()
Entity getRootEntity()
boolean isRootEntity()
boolean isRootOfInheritanceHierarchy()
Entity getTableProvidingEntity()
InheritanceType getInheritanceType()
InheritanceType getHierarchyInheritanceType()
InheritanceType.NONE, the type of the super entity is returned.String getSuperEntityName()
Entity getSuperEntity()
List<Entity> getSuperEntities()
Entity getTopSuperEntity()
List<Entity> getInheritanceChain(Entity subEntity) throws ModelException
subEntity - the sub entityModelException - if subEntity does not inherit this entityint getInheritanceLevel()
List<Entity> getSubEntities()
List<Entity> getAllSubEntities()
List<Entity> getLeafEntities()
Set<Entity> getAssociatedEntities()
Set<List<Relation>> getCompositePaths()
Set<List<Relation>> getAllCompositePaths()
Set<Entity> getComponents()
Set<Entity> getComponentsIncludingInherited()
Set<Entity> getAllComponents()
boolean isProvidingRootClassIdAccordingToModel()
boolean isProvidingRootIdAccordingToModel()
boolean isRootEntityAccordingToModel()
List<Relation> getDeepReferences()
boolean isDeeplyReferenced()
List<Relation> getDeepReferencesToComponents()
List<Relation> getDeeplyReferencedComponents()
isDeeplyReferenced() is true.Tentackle - distributed, domain- and model-driven