Class EntityReference

java.lang.Object
com.aquima.interactions.metamodel.EntityReference
All Implemented Interfaces:
Serializable

public class EntityReference extends Object implements 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

    Constructors
    Constructor
    Description
    Constructs a new EntityReference instance with all relations included.
    EntityReference(String entityName)
    Constructs a new, non-root EntityReference instance with no relations included
    EntityReference(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 Type
    Method
    Description
    boolean
    containsRelation(String relationName)
    Indicates whether a relation of the referred entity is included in this entity reference.
    Returns the name of the entity referenced.
    Returns the relations included in this entity reference, which is a (potentially empty) subset of all relations of the referred entity.
    boolean
    Indicates whether the referred entity is a root entity in the aggregate which contains this entity reference.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • EntityReference

      public EntityReference(IMetaModel metamodel, IEntityReferenceDS datasource)
      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

      public EntityReference(String entityName)
      Constructs a new, non-root EntityReference instance with no relations included
      Parameters:
      entityName - The entity name, may not be null or empty
    • EntityReference

      public EntityReference(String entityName, String[] relations)
      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

      public EntityReference(String entityName, String[] relations, boolean root)
      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

      public String 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

      public String[] 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

      public boolean containsRelation(String relationName)
      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

      public String toString()
      Overrides:
      toString in class Object