RelationBuilder
Defined in: builder/relation.ts:15
Relations define relationships between templates in Alpyne. Relations are from a template to another. For example an employee has a parking space. This would be a “from employee” has one-to-one “to parking space”. In this case the “from” template is the employee and the “to” template is the parking space.
It is possible to navigate this relationship from either side. What is the from and to is largely a semantic and domain modelling decision.
Extends
Section titled “Extends”Properties
Section titled “Properties”cardinality
Section titled “cardinality”
readonlycardinality:RelationCardinality
Defined in: builder/relation.ts:19
The cardinality (e.g. one-to-many).
evented
Section titled “evented”
readonlyevented: (key?) =>EventBuilder
Defined in: builder/relation.ts:24
Flags that this relation will fire an event when set, updated, or removed.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”fromKey
Section titled “fromKey”
readonlyfromKey:string
Defined in: builder/relation.ts:29
The key on the from template.
readonlyprn:string
Defined in: builder/index.ts:32
Inherited from
Section titled “Inherited from”
readonlytoKey:string
Defined in: builder/relation.ts:37
The key on the to template. Often this is the same as the “from”, but it may be changed if there is a conflict or a different term makes sense when navigating to->from. For example a manager relation might be “manages” one way, but “hasManager” the other.
Methods
Section titled “Methods”setDescription()
Section titled “setDescription()”setDescription(
description):this
Defined in: builder/index.ts:33
Parameters
Section titled “Parameters”description
Section titled “description”string
Returns
Section titled “Returns”this