Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a link from one entity to one other linked entity (as opposed to a list of linked entities). In OData v2 a OneToOneLink can be used to filter and order a selection on an entity based on filters and orders on a linked entity.

Type parameters

  • EntityT: EntityBase

    Type of the entity to be linked from

  • LinkedEntityT: EntityBase

    Type of the entity to be linked to

Hierarchy

  • Link<EntityT, LinkedEntityT>
    • OneToOneLink

Index

Constructors

constructor

  • new OneToOneLink<EntityT, LinkedEntityT>(_fieldName: string, _entityConstructor: Constructable<EntityT, unknown>, _linkedEntity: Constructable<LinkedEntityT, unknown>): OneToOneLink<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 OneToOneLink<EntityT, LinkedEntityT>

Properties

Readonly _entity

_entity: EntityT

Readonly _entityConstructor

_entityConstructor: Constructable<EntityT, unknown>

_expand

_expand: Expandable<LinkedEntityT>[]

Readonly _fieldName

_fieldName: string

Readonly _linkedEntity

_linkedEntity: Constructable<LinkedEntityT, unknown>

_selects

_selects: Selectable<LinkedEntityT>[]

List of selectables on the linked entity.

filters

filters: Filterable<LinkedEntityT, any>

Filterables to apply to the given entity based on the linked entity.

orderBys

orderBys: Order<LinkedEntityT>[]

List of criteria of the linked entity to order the given entity by with descending priority.

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 OneToOneLink<EntityT, LinkedEntityT>

    Newly created link

expand

  • Parameters

    Returns OneToOneLink<EntityT, LinkedEntityT>

filter

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

    Parameters

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

      Filters based on the linked entity.

    Returns FilterLink<EntityT, LinkedEntityT>

    Newly created FilterLink.

orderBy

  • Create order statements for the OData request based on the linked entity. The given statements have descending priority.

    Example:

    Entity.requestBuilder()
    .getAll()
    .orderBy(Entity.TO_LINKED_ENTITY.orderBy(asc(LinkedEntity.PROPERTY1), desc(LinkedEntity.PROPERTY2)));

    Parameters

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

      Criteria to order by

    Returns OrderLink<EntityT, LinkedEntityT>

    Newly created order link

select

Static clone

  • deprecated

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

    typeparam EntityT

    Type of the entity to be linked from

    typeparam LinkedEntityT

    Type of the entity to be linked to

    Type parameters

    Parameters

    • link: OneToOneLink<EntityT1, LinkedEntityT1>

      Link to be cloned

    Returns OneToOneLink<EntityT1, LinkedEntityT1>

    Newly created link

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