Class ComplexTypeField<EntityT, DeSerializersT, 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 extends EntityBase

    Type of the entity the field belongs to.

  • DeSerializersT extends DeSerializers

    Type of the (de-)serializers.

  • ComplexT = any

    Type of complex type represented by this field.

  • NullableT extends boolean = false

    Boolean type that represents whether the field is nullable.

  • SelectableT extends boolean = false

    Boolean type that represents whether the field is selectable.

Hierarchy

  • Field<EntityT, NullableT, SelectableT>
    • ComplexTypeField

Constructors

  • Creates an instance of ComplexTypeField.

    Type Parameters

    • EntityT extends EntityBase<EntityT>

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

    • ComplexT = any

    • NullableT extends boolean = false

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

    • deSerializers: DeSerializersT

      (De-)serializers used for transformation.

    • _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, DeSerializersT, ComplexT, NullableT, SelectableT>

Properties

_complexType: ComplexTypeNamespace<ComplexT>
_entityConstructor: Constructable<EntityT>
_fieldName: string
_fieldOptions: Required<FieldOptions<NullableT, SelectableT>>
complexTypeName?: string

Note that this property is crucial, although not really used. If it is removed this class becomes structural equivalent to e.g. ComplexTypeStringPropertyField which leads to unexpected behavior on the selectable list of objects.

deSerializers: DeSerializersT
fieldOf: ConstructorOrField<EntityT, ComplexT>

Methods

  • Gets the path to the complex type property represented by this.

    Returns

    The path to the complex type property.

    Returns string

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