Version: 4.3

Class: Hydrator

Hierarchy

Implements

Constructors

constructor

+ new Hydrator(metadata: MetadataStorage, platform: Platform, config: Configuration): Hydrator

Defined in packages/core/src/hydration/Hydrator.ts:8

Parameters:

NameType
metadataMetadataStorage
platformPlatform
configConfiguration

Returns: Hydrator

Properties

config

Protected Readonly config: Configuration

Defined in packages/core/src/hydration/Hydrator.ts:12


metadata

Protected Readonly metadata: MetadataStorage

Defined in packages/core/src/hydration/Hydrator.ts:10


platform

Protected Readonly platform: Platform

Defined in packages/core/src/hydration/Hydrator.ts:11

Methods

getProperties

ProtectedgetProperties<T>(meta: EntityMetadata<T>, type: "full" | "returning" | "reference"): EntityProperty<T>[]

Defined in packages/core/src/hydration/Hydrator.ts:34

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
metaEntityMetadata<T>
type"full" | "returning" | "reference"

Returns: EntityProperty<T>[]


hydrate

hydrate<T>(entity: T, meta: EntityMetadata<T>, data: EntityData<T>, factory: EntityFactory, type: "full" | "returning" | "reference", newEntity?: boolean, convertCustomTypes?: boolean): void

Implementation of IHydrator

Defined in packages/core/src/hydration/Hydrator.ts:17

Hydrates the whole entity. This process handles custom type conversions, creating missing Collection instances, mapping FKs to entity instances, as well as merging those entities.

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameTypeDefault value
entityT-
metaEntityMetadata<T>-
dataEntityData<T>-
factoryEntityFactory-
type"full" | "returning" | "reference"-
newEntitybooleanfalse
convertCustomTypesbooleanfalse

Returns: void


hydrateProperty

ProtectedhydrateProperty<T>(entity: T, prop: EntityProperty, data: EntityData<T>, factory: EntityFactory, newEntity?: boolean, convertCustomTypes?: boolean): void

Defined in packages/core/src/hydration/Hydrator.ts:47

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityT
propEntityProperty
dataEntityData<T>
factoryEntityFactory
newEntity?boolean
convertCustomTypes?boolean

Returns: void


hydrateReference

hydrateReference<T>(entity: T, meta: EntityMetadata<T>, data: EntityData<T>, factory: EntityFactory, convertCustomTypes?: boolean): void

Implementation of IHydrator

Defined in packages/core/src/hydration/Hydrator.ts:28

Hydrates primary keys only

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityT
metaEntityMetadata<T>
dataEntityData<T>
factoryEntityFactory
convertCustomTypes?boolean

Returns: void

Last updated on by Martin Adámek