Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RelationshipStore

Stores relationships and provides lookup functions.

Hierarchy

  • RelationshipStore

Index

Methods

addRelationshipMetadata

getRelationship

  • Get the relationship between two tables on a property. Short-hand for getRelationships with oneWay=true, but throws if the relationship does not exist.

    Parameters

    • Entity1: TableType

      The first Entity (constructor), i.e. the class that's decorated with @Table.

    • Entity2: TableType

      The second Entity.

    • mapTo: string

      The proeprty on Entity1 where the relationship is defined.

    Returns RelationshipMetadata

    The RelationshipMetadata for the relationship.

getRelationships

  • Get all of the relationships between two tables, or for a single table.

    Parameters

    • Entity1: TableType

      The first Entity (constructor), i.e. the class that's decorated with @Table.

    • Default value Entity2: TableType = null

      The second Entity.

    • Default value oneWay: boolean = false

      When true, only return the relationships that Entity1 owns.

    • Default value mapTo: string = null

      An optional property on Entity1. If passed, return the relationship for this property only (implies oneWay).

    Returns RelationshipMetadata[]

    An array of RelationshipMetadata instances.

Generated using TypeDoc