Class OneToOneLink<EntityT, DeSerializersT, LinkedEntityApiT>

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 Param

Type of the entity to be linked to.

Type Parameters

Hierarchy

  • Link<EntityT, DeSerializersT, LinkedEntityApiT>
    • OneToOneLink

Constructors

  • Creates an instance of Link.

    Type Parameters

    • EntityT extends EntityBase<EntityT>

    • DeSerializersT extends DeSerializers<any, any, any, any, any, any, any, any, any, any, any, any, any, any, DeSerializersT>

    • LinkedEntityApiT extends EntityApi<EntityBase, DeSerializersT, LinkedEntityApiT>

    Parameters

    • _fieldName: string

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

    • _entityApi: EntityApi<EntityT, DeSerializersT>

      Entity API for building and executing the request.

    • _linkedEntityApi: LinkedEntityApiT

      Constructor of the linked entity.

    Returns OneToOneLink<EntityT, DeSerializersT, LinkedEntityApiT>

Properties

_deSerializers: DeSerializersT

Dummy property to include also the deserializer type in the strucutre of the entity type.

_entity: EntityT

Dummy property whose type makes structurally identical entities distiguishable in TypeScript.

_entityApi: EntityApi<EntityT, DeSerializersT>
_expand: Expandable<EntityType<LinkedEntityApiT>, DeSerializersT, EntityApi<EntityBase, DeSerializersT>>[]
_fieldName: string
_linkedEntityApi: LinkedEntityApiT
_selects: Selectable<EntityType<LinkedEntityApiT>, DeSerializersT>[]

List of selectables on the linked entity.

filters: Filterable<EntityType<LinkedEntityApiT>, DeSerializersT, EntityApi<EntityBase, any>>

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

orderBys: Order<EntityType<LinkedEntityApiT>>[]

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

Methods

  • Create a new link based on a given link.

    Returns

    Newly created link.

    Returns OneToOneLink<EntityT, DeSerializersT, LinkedEntityApiT>

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

    Returns

    Newly created FilterLink.

    Parameters

    Returns FilterLink<EntityT, DeSerializersT, LinkedEntityApiT>

  • 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)));

    Returns

    Newly created order link.

    Parameters

    Returns OrderLink<EntityT, LinkedEntityApiT>

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