Class RelationDefinition
java.lang.Object
com.aquima.interactions.metamodel.impl.RelationDefinition
- All Implemented Interfaces:
IRelationDefinition
,Serializable
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 Summary
ConstructorsModifierConstructorDescriptionRelationDefinition
(IRelationDS datasource, boolean isReverse) Constructs a relation definition with the information provided by the data source.protected
-
Method Summary
Modifier and TypeMethodDescriptionThis method returns the name of the attribute that refers back to the referrer.This method return the name of the entity this relation is referring to.This method returns the explain text of the relation, as defined in Studio.This method returns the question text of the relation, as defined in Studio.getType()
This method returns the type of the relation.boolean
This method returns a boolean indicating this attribute is a reverse relation attribute as defined in studio.boolean
This method can be used to determine if the object that this relation is referring to is owned by the object referring it.protected void
setAttribute
(String attribute)
-
Constructor Details
-
RelationDefinition
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
-
-
Method Details
-
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 theRelationType
for more information about the various supported types.- Specified by:
getType
in interfaceIRelationDefinition
- 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 interfaceIRelationDefinition
- Returns:
- boolean
-
getEntityName
Description copied from interface:IRelationDefinition
This method return the name of the entity this relation is referring to.- Specified by:
getEntityName
in interfaceIRelationDefinition
- Returns:
- String containing the name of the entity that this relation refers to.
-
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 interfaceIRelationDefinition
- Returns:
- String name of the attribute that refers back to the object containing this relation.
-
setAttribute
-
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 interfaceIRelationDefinition
- Returns:
- A boolean indicating this attribute is a reverse relation attribute.
-
getQuestionText
Description copied from interface:IRelationDefinition
This method returns the question text of the relation, as defined in Studio.- Specified by:
getQuestionText
in interfaceIRelationDefinition
- Returns:
- An IMultilingualText containing the relation question text, as defined in Studio.
-
getExplainText
Description copied from interface:IRelationDefinition
This method returns the explain text of the relation, as defined in Studio.- Specified by:
getExplainText
in interfaceIRelationDefinition
- Returns:
- An IMultilingualText containing the relation explain text, as defined in Studio.
-