Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a one to many relation for OData v4 entites. For OData v2 entites the Link is used to represent one to many relation.

See also Link for more informations.

Type parameters

Hierarchy

  • Link<EntityT, LinkedEntityT>
    • OneToManyLink

Index

Constructors

constructor

  • new OneToManyLink<EntityT, LinkedEntityT>(_fieldName: string, _entityConstructor: Constructable<EntityT, unknown>, _linkedEntity: Constructable<LinkedEntityT, unknown>): OneToManyLink<EntityT, LinkedEntityT>
  • Creates an instance of Link.

    Type parameters

    Parameters

    • _fieldName: string

      Name of the linking field to be used in the OData request.

    • _entityConstructor: Constructable<EntityT, unknown>

      Constructor type of the entity the field belongs to

    • _linkedEntity: Constructable<LinkedEntityT, unknown>

      Constructor type of the linked entity

    Returns OneToManyLink<EntityT, LinkedEntityT>

Properties

Readonly _entity

_entity: EntityT

Readonly _entityConstructor

_entityConstructor: Constructable<EntityT, unknown>

_expand

_expand: Expandable<LinkedEntityT>[]

Readonly _fieldName

_fieldName: string

_filters

_filters: FilterLink<EntityT, LinkedEntityT>

Readonly _linkedEntity

_linkedEntity: Constructable<LinkedEntityT, unknown>

_orderBy

_orderBy: Orderable<LinkedEntityT>[]

_selects

_selects: Selectable<LinkedEntityT>[]

List of selectables on the linked entity.

_skip

_skip: number

_top

_top: number

Accessors

selects

  • deprecated

    Since v1.21.0. Use _selects directly. List of selectables on the linked entity.

    Returns Selectable<LinkedEntityT>[]

Methods

clone

  • Returns OneToManyLink<EntityT, LinkedEntityT>

expand

  • Parameters

    Returns OneToManyLink<EntityT, LinkedEntityT>

filter

  • Create filter statements to be applied to the OData request based on the linked entity values.

    Parameters

    Returns OneToManyLink<EntityT, LinkedEntityT>

    Newly created Filterlink

orderBy

  • Add order-by statements to the request.

    Parameters

    • Rest ...orderBy: Orderable<LinkedEntityT>[]

      OrderBy statements to order the response by

    Returns OneToManyLink<EntityT, LinkedEntityT>

    The request builder itself, to facilitate method chaining

select

skip

  • Skip number of entities.

    Parameters

    • skip: number

      Number of matching entities to skip. Useful for paging

    Returns OneToManyLink<EntityT, LinkedEntityT>

    The request builder itself, to facilitate method chaining

top

  • Limit number of returned entities.

    Parameters

    • top: number

      Maximum number of entities to return in the response. Can be less, if less entities match the request

    Returns OneToManyLink<EntityT, LinkedEntityT>

    The request builder itself, to facilitate method chaining

Static clone

  • clone<EntityT1, LinkedEntityT1>(link: Link<EntityT1, LinkedEntityT1>): Link<EntityT1, LinkedEntityT1>
  • deprecated

    Since v1.21.0. Use clone instead. Create a new link based on a given link.

    typeparam

    Type of the entity to be linked from

    typeparam

    Type of the entity to be linked to

    Type parameters

    Parameters

    • link: Link<EntityT1, LinkedEntityT1>

      Link to be cloned

    Returns Link<EntityT1, LinkedEntityT1>

    Newly created link