redux-data-service > IFieldRelationship
This is the meta-data about a related field on a Model
, such as a BelongsTo
or HasMany
field. It enables us to lazy-load the related model(s) given a field which specifies the related ID(s) and the related service name.
For example, field "student" relates to the "student" service through the "studentId" relatedFieldName.
IFieldRelationship
● field: string
Defined in Model/Decorators/Relationship.ts:22
The name of the field this relationship decorates
● modelRelatedFieldName: string
Defined in Model/Decorators/Relationship.ts:34
The name of the field on the OTHER model which provides the ID of THIS model
● relatedFieldName: string
Defined in Model/Decorators/Relationship.ts:31
The field on THIS model which provides the ID or IDs to identify the OTHER model
● serviceName: string
Defined in Model/Decorators/Relationship.ts:25
The name of the service associated to the related field
● serviceNameField: string
Defined in Model/Decorators/Relationship.ts:28
When no serviceName is given, we will use the value of this field to get the name of the related service
● type: RelationshipType
Defined in Model/Decorators/Relationship.ts:37
The type of relationship, i.e. BelongsTo (one-to-one or one-to-many) or HasMany (many-to-many, many-to-one)