Skip to main content
Version: 2.10

defineRelation()

Call Signature

function defineRelation<O, D>(
tag,
origin?,
destination?,
direction?): Relation<O, D>

Create a constant relation object between two specified DataTypes.

That constant is used especially to create queries see Query.follow | Query.follow(relation)

Type Parameters

Type Parameter
O extends CloudObject
D extends CloudObject

Parameters

ParameterTypeDescription
tagInstanceOrTagtag of the relation
origin?Class<O>origin DataType of the relation
destination?Class<D>destination DataType of the relation. Default is CloudObject
direction?Directiondirection of the relation, pointing towards origin or destination. Default is DESTINATION

Returns

Relation<O, D>

newly defined relation

Call Signature

function defineRelation(tag, direction?): Relation<CloudObject, CloudObject>

Create a constant relation object between two generic CloudObjects

That constant is used especially to create queries see Query.follow | Query.follow(relation)

Parameters

ParameterTypeDescription
tagInstanceOrTagtag of the relation
direction?Directiondirection of the relation, pointing towards origin or destination. Default is DESTINATION

Returns

Relation<CloudObject, CloudObject>

newly defined relation