Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OneToOneLink<EntityT, LinkedEntityT>

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

Implements

  • EntityIdentifiable<EntityT>

Index

Constructors

constructor

  • new OneToOneLink(_fieldName: string, _entityConstructor: Constructable<EntityT>, _linkedEntity: Constructable<LinkedEntityT>): OneToOneLink
  • Creates an instance of Link.

    Parameters

    • _fieldName: string

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

    • _entityConstructor: Constructable<EntityT>

      Constructor type of the entity the field belongs to

    • _linkedEntity: Constructable<LinkedEntityT>

      Constructor type of the linked entity

    Returns OneToOneLink

Properties

Readonly _entity

_entity: EntityT

Readonly _entityConstructor

_entityConstructor: Constructable<EntityT>

Constructor type of the entity the field belongs to

_expand

_expand: Expandable<LinkedEntityT>[] = []

Readonly _fieldName

_fieldName: string

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

Readonly _linkedEntity

_linkedEntity: Constructable<LinkedEntityT>

Constructor type of the linked entity

_selects

_selects: Selectable<LinkedEntityT>[] = []

List of selectables on the linked entity.

filters

filters: Filterable<LinkedEntityT>

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

Methods

clone

  • clone(): this

expand

  • expand(...expands: Expandable<LinkedEntityT>[]): this

filter

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

  • select(...selects: Selectable<LinkedEntityT>[]): this

Static clone