Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ComplexTypeField<EntityT, ComplexT, NullableT, SelectableT> Abstract

Represents a complex type property of an entity or a complex type.

ComplexTypeFields are used as static properties of entities and are generated from the metadata, i.e. for each property of an OData entity, that has a complex type, there exists one static instance of ComplexTypeField (or rather one of its subclasses) in the corresponding generated class file. ComplexTypeFields are used to represent the domain of complex or custom structures that can be used in select, filter and order by functions. For example, when constructing a query on the TimeSheetEntry entity, an instance of ComplexTypeField<TimeSheetEntry> can be supplied as argument to the select function, e.g. TimeSheetEntry.TIME_SHEET_DATA_FIELDS. Moreover, classes implementing this abstract class will provide property fields, that can be used for filtering and ordering.

See also: Selectable

Type parameters

  • EntityT: EntityBase

    Type of the entity the field belongs to.

  • ComplexT = any

    Type of complex type represented by this field.

  • NullableT: boolean = false

    Boolean type that represents whether the field is nullable.

  • SelectableT: boolean = false

    Boolean type that represents whether the field is selectable.

Hierarchy

  • Field<EntityT, NullableT, SelectableT>
    • ComplexTypeField

Index

Constructors

  • new ComplexTypeField<EntityT, ComplexT, NullableT, SelectableT>(fieldName: string, entityConstructor: Constructable<EntityT, unknown>, complexTypeName: string): ComplexTypeField<EntityT, ComplexT, NullableT, SelectableT>
  • new ComplexTypeField<EntityT, ComplexT, NullableT, SelectableT>(fieldName: string, fieldOf: ConstructorOrField<EntityT, ComplexT>): ComplexTypeField<EntityT, ComplexT, NullableT, SelectableT>
  • new ComplexTypeField<EntityT, ComplexT, NullableT, SelectableT>(fieldName: string, fieldOf: ConstructorOrField<EntityT, ComplexT>, complexType: ComplexTypeNamespace<ComplexT>, fieldOptions?: FieldOptions<NullableT, SelectableT>): ComplexTypeField<EntityT, ComplexT, NullableT, SelectableT>
  • deprecated

    Since v1.19.0.

    Creates an instance of ComplexTypeField.

    Type parameters

    • EntityT: EntityBase<EntityT>

    • ComplexT = any

    • NullableT: boolean = false

    • SelectableT: boolean = false

    Parameters

    • fieldName: string

      Actual name of the field as used in the OData request.

    • entityConstructor: Constructable<EntityT, unknown>

      Constructor type of the entity the field belongs to.

    • complexTypeName: string

      Name of the type of the field according to the metadata description.

    Returns ComplexTypeField<EntityT, ComplexT, NullableT, SelectableT>

  • deprecated

    Since v1.27.0. Use other constructors instead. Creates an instance of ComplexTypeField.

    Type parameters

    • EntityT: EntityBase<EntityT>

    • ComplexT = any

    • NullableT: boolean = false

    • SelectableT: boolean = false

    Parameters

    • fieldName: string

      Actual name of the field as used in the OData request.

    • fieldOf: ConstructorOrField<EntityT, ComplexT>

      Either the parent entity constructor of the parent complex type this field belongs to.

    Returns ComplexTypeField<EntityT, ComplexT, NullableT, SelectableT>

  • Creates an instance of ComplexTypeField.

    Type parameters

    • EntityT: EntityBase<EntityT>

    • ComplexT = any

    • NullableT: boolean = false

    • SelectableT: boolean = false

    Parameters

    • fieldName: string

      Actual name of the field as used in the OData request.

    • fieldOf: ConstructorOrField<EntityT, ComplexT>

      Either the parent entity constructor of the parent complex type this field belongs to.

    • complexType: ComplexTypeNamespace<ComplexT>

      The complex type of the complex type property represented by this.

    • Optional fieldOptions: FieldOptions<NullableT, SelectableT>

      Optional settings for this field.

    Returns ComplexTypeField<EntityT, ComplexT, NullableT, SelectableT>

Properties

_complexType: ComplexTypeNamespace<ComplexT>

The complex type of the complex type property represented by this.

_entity: EntityT
_entityConstructor: Constructable<EntityT, unknown>
_fieldName: string
_fieldOptions: Required<FieldOptions<NullableT, SelectableT>>
fieldOf: ConstructorOrField<EntityT, ComplexT>

Methods

  • fieldPath(): string
  • Gets the path to the complex type property represented by this.

    Returns string

    The path to the complex type property.

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