Class EntityReference
java.lang.Object
com.aquima.interactions.metamodel.EntityReference
- All Implemented Interfaces:
Serializable
Simple class that holds a reference to an entity. The entity reference consist of entity name and a subset of the
relations of the referred entity.
- Author:
- Voicu Moldovan, Petru Galanton
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEntityReference
(IMetaModel metamodel, IEntityReferenceDS datasource) Constructs a new EntityReference instance with all relations included.EntityReference
(String entityName) Constructs a new, non-root EntityReference instance with no relations includedEntityReference
(String entityName, String[] relations) Constructs a new, non-root EntityReference to the specified entity and with the specified relations included.EntityReference
(String entityName, String[] relations, boolean root) Constructs a new EntityReference to the specified entity and with the specified relations included. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsRelation
(String relationName) Indicates whether a relation of the referred entity is included in this entity reference.Returns the name of the entity referenced.String[]
Returns the relations included in this entity reference, which is a (potentially empty) subset of all relations of the referred entity.boolean
isRoot()
Indicates whether the referred entity is a root entity in the aggregate which contains this entity reference.toString()
-
Constructor Details
-
EntityReference
Constructs a new EntityReference instance with all relations included.- Parameters:
metamodel
- The meta model definition that contains the entity.datasource
- The entity reference data source.
-
EntityReference
Constructs a new, non-root EntityReference instance with no relations included- Parameters:
entityName
- The entity name, may not be null or empty
-
EntityReference
Constructs a new, non-root EntityReference to the specified entity and with the specified relations included.- Parameters:
entityName
- The entity name, may not be null or empty.relations
- The included relation names, may be empty but may not be null.
-
EntityReference
Constructs a new EntityReference to the specified entity and with the specified relations included.- Parameters:
entityName
- The entity name, may not be null or empty.relations
- The included relation names, may be empty but may not be null.root
- whether this is a root reference in an aggregate
-
-
Method Details
-
getEntityName
Returns the name of the entity referenced.- Returns:
- The entity name.
-
isRoot
public boolean isRoot()Indicates whether the referred entity is a root entity in the aggregate which contains this entity reference.- Returns:
- true if the referred entity is a root entity, false otherwise.
-
getRelations
Returns the relations included in this entity reference, which is a (potentially empty) subset of all relations of the referred entity.- Returns:
- the relations included in this entity reference.
-
containsRelation
Indicates whether a relation of the referred entity is included in this entity reference.- Parameters:
relationName
- the name of the relation- Returns:
- true if the relation is included in this entity reference, false otherwise
-
toString
-