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

  • 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

_entity: EntityT
_entityConstructor: Constructable<EntityT, unknown>
_expand: Expandable<LinkedEntityT>[]
_fieldName: string
_filters: FilterLink<EntityT, LinkedEntityT>
_linkedEntity: Constructable<LinkedEntityT, unknown>
_orderBy: Orderable<LinkedEntityT>[]
_selects: Selectable<LinkedEntityT>[]

List of selectables on the linked entity.

_skip: number
_top: number

Accessors

  • deprecated

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

    Returns Selectable<LinkedEntityT>[]

Methods

  • Create a new link based on a given link.

    Returns OneToManyLink<EntityT, LinkedEntityT>

    Newly created link

  • Parameters

    Returns OneToManyLink<EntityT, LinkedEntityT>

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

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

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

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

  • 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 Ⓒ 2023 SAP SE or an SAP affiliate company. All rights reserved.