Skip to main content

ModelRelations

@webda/content-mapper


Interface: ModelRelations

Defined in: packages/content-mapper/src/module-discovery.ts:664

Relations recorded for a model.

Properties​

behaviors?​

optional behaviors?: object[]

Defined in: packages/content-mapper/src/module-discovery.ts:680

Behaviour-typed attributes.

attribute​

attribute: string

behavior​

behavior: string


children?​

optional children?: string[]

Defined in: packages/content-mapper/src/module-discovery.ts:682

Models declaring this model as their parent, filled by backfillModelRelations.


dependents?​

optional dependents?: RelationDependent[]

Defined in: packages/content-mapper/src/module-discovery.ts:684

Relations targeting this model with a delete policy, filled by backfillModelRelations.


optional links?: object[]

Defined in: packages/content-mapper/src/module-discovery.ts:674

Outgoing links, from the ModelLink* family.

model is absent when the target is a type parameter, as on a generic base class — the link is still real and is recorded without it. onDelete is absent for the default NONE; ownership marks a Contains.

attribute​

attribute: string

model?​

optional model?: string

onDelete?​

optional onDelete?: "CASCADE" | "RESTRICT" | "SET_NULL" | "NONE"

ownership?​

optional ownership?: "CONTAINS"

type​

type: string


parent?​

optional parent?: object

Defined in: packages/content-mapper/src/module-discovery.ts:666

Owning model, from a ModelParent<T> attribute, and the policy applied to the model when it is deleted.

attribute​

attribute: string

model​

model: string

onDelete​

onDelete: "CASCADE" | "RESTRICT" | "SET_NULL" | "NONE"


optional polymorphicLinks?: object[]

Defined in: packages/content-mapper/src/module-discovery.ts:676

Polymorphic references, optionally constrained to exact model identifiers.

attribute​

attribute: string

models?​

optional models?: string[]


queries?​

optional queries?: object[]

Defined in: packages/content-mapper/src/module-discovery.ts:678

Reverse lookups, from ModelRelated<T, U, "attr">.

attribute​

attribute: string

model​

model: string

targetAttribute?​

optional targetAttribute?: string