Type alias PolyBelongsToDefinition

PolyBelongsToDefinition: {
    discriminator?: string;
    foreignKey?: string;
    polymorphic: true;
    type: BELONGS_TO;
}

The polymorphic "belongsTo" relation.

Type declaration

  • Optional discriminator?: string
  • Optional foreignKey?: string
  • polymorphic: true
  • type: BELONGS_TO

Example: Required fields only.

{
type: RelationType.BELONGS_TO,
polymorphic: true,
}

Example: Verbose definition.

{
type: RelationType.BELONGS_TO,
polymorphic: true,
foreignKey: 'referenceId',
discriminator: 'referenceType',
}

Generated using TypeDoc