Class RelationDefinition

java.lang.Object
com.aquima.interactions.metamodel.impl.RelationDefinition
All Implemented Interfaces:
IRelationDefinition, Serializable

public class RelationDefinition extends Object implements IRelationDefinition
This class hold the definition of a relation between two entities. The relation consists of a type and name of the entity referred to, and optionally an attribute that defines the relation back.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • RelationDefinition

      public RelationDefinition(IRelationDS datasource, boolean isReverse)
      Constructs a relation definition with the information provided by the data source.
      Parameters:
      datasource - Data source implementation that provides the relation information.
      isReverse - Boolean indicating if this relation is defined as a 'reverse' relation in Studio.
    • RelationDefinition

      protected RelationDefinition(IRelationDefinition other)
  • Method Details

    • getType

      public RelationType getType()
      Description copied from interface: IRelationDefinition
      This method returns the type of the relation. The most important type at this moment (as it is the only one that can be modeled) is the associative relation type. Please refer to the RelationType for more information about the various supported types.
      Specified by:
      getType in interface IRelationDefinition
      Returns:
      RelationType denoting the type of the relation.
    • referrerIsOwner

      public boolean referrerIsOwner()
      Description copied from interface: IRelationDefinition
      This method can be used to determine if the object that this relation is referring to is owned by the object referring it. This method is only relevant with relations that have a directed (parent-child) relation type. With a directed relation, one of the objects is considered the owner (parent).
      Specified by:
      referrerIsOwner in interface IRelationDefinition
      Returns:
      boolean
    • getEntityName

      public String getEntityName()
      Description copied from interface: IRelationDefinition
      This method return the name of the entity this relation is referring to.
      Specified by:
      getEntityName in interface IRelationDefinition
      Returns:
      String containing the name of the entity that this relation refers to.
    • getAttribute

      public String getAttribute()
      Description copied from interface: IRelationDefinition

      This method returns the name of the attribute that refers back to the referrer. The attribute referring back may be empty for relations that are specified in only a single direction.

      For example: A person might have a relation defined to a car, where as the car might have the reverse relation though the attribute owner. For the relation defined in person, this getAttribute method will return the attribute referring back to the person (the owner attribute). The relation definition of the car will return the attribute car from person, as that attribute refers back to the car.

      Specified by:
      getAttribute in interface IRelationDefinition
      Returns:
      String name of the attribute that refers back to the object containing this relation.
    • setAttribute

      protected void setAttribute(String attribute)
    • isReverseAttribute

      public boolean isReverseAttribute()
      Description copied from interface: IRelationDefinition
      This method returns a boolean indicating this attribute is a reverse relation attribute as defined in studio. This method is not (yet) deprecated: This method should not be needed when composite relations are defined in studio.
      Specified by:
      isReverseAttribute in interface IRelationDefinition
      Returns:
      A boolean indicating this attribute is a reverse relation attribute.
    • getQuestionText

      public IMultilingualText getQuestionText()
      Description copied from interface: IRelationDefinition
      This method returns the question text of the relation, as defined in Studio.
      Specified by:
      getQuestionText in interface IRelationDefinition
      Returns:
      An IMultilingualText containing the relation question text, as defined in Studio.
    • getExplainText

      public IMultilingualText getExplainText()
      Description copied from interface: IRelationDefinition
      This method returns the explain text of the relation, as defined in Studio.
      Specified by:
      getExplainText in interface IRelationDefinition
      Returns:
      An IMultilingualText containing the relation explain text, as defined in Studio.