Page Contents
Home > @loopback/repository > RelationDefinitionBase
RelationDefinitionBase interface
Signature:
export interface RelationDefinitionBase
Properties
| Property | Type | Description |
|---|---|---|
| name | string | The relation name, typically matching the name of the accessor property defined on the source model. For example “orders” or “customer”. |
| source | typeof Entity | The source model of this relation.E.g. when a Customer has many Order instances, then Customer is the source. |
| target | TypeResolver<Entity, typeof Entity> | The target model of this relation.E.g. when a Customer has many Order instances, then Order is the target. |
| targetsMany | boolean | True for relations targeting multiple instances (e.g. HasMany), false for relations with a single target (e.g. BelongsTo, HasOne). This property is needed by OpenAPI/JSON Schema generator. |
| type | RelationType | The type of the relation, must be one of RelationType values. |