Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a one to many relation for OData v4 entities. For OData v2 entities the Link is used to represent one to many relation. See Link for more information.

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

  • Create a new link based on a given link.

    Returns OneToManyLink<EntityT, LinkedEntityT>

    Newly created link

expand

  • Parameters

    Returns OneToManyLink<EntityT, LinkedEntityT>

filter

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

    Parameters

    • Rest ...expressions: Filterable<LinkedEntityT, any>[]

    Returns OneToManyLink<EntityT, LinkedEntityT>

    Newly created FilterLink.

orderBy

  • Add order-by statements to the request.

    • @param orderBy - OrderBy statements to order the response by.

    Parameters

    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

  • 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.

    Type parameters

    Parameters

    • link: Link<EntityT1, LinkedEntityT1>

      Link to be cloned

    Returns Link<EntityT1, LinkedEntityT1>

    Newly created link

    Copyright Ⓒ 2021 SAP SE or an SAP affiliate company. All rights reserved.