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

  • 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

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

List of selectables on the linked entity.

filters: Filterable<LinkedEntityT, any>

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

orderBys: Order<LinkedEntityT>[]

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

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

    Newly created link

  • Parameters

    Returns OneToOneLink<EntityT, LinkedEntityT>

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

  • 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

  • deprecated

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

    Type parameters

    Parameters

    • link: OneToOneLink<EntityT1, LinkedEntityT1>

      Link to be cloned

    Returns OneToOneLink<EntityT1, LinkedEntityT1>

    Newly created link

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