Page Contents

Home > @loopback/repository > RelationDefinitionBase

RelationDefinitionBase interface

Signature:

export interface RelationDefinitionBase 

Properties

Property Modifiers 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 <p>The source model of this relation.</p><p>E.g. when a Customer has many Order instances, then Customer is the source.</p>
target   TypeResolver<Entity, typeof Entity> <p>The target model of this relation.</p><p>E.g. when a Customer has many Order instances, then Order is the target.</p>
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.