Skip to main content
Version: 4.5

Class: ObjectHydrator#

core.ObjectHydrator

Hierarchy#

Constructors#

constructor#

+ new ObjectHydrator(metadata: MetadataStorage, platform: Platform, config: Configuration<IDatabaseDriver<Connection>>): ObjectHydrator

Parameters:#

NameType
metadataMetadataStorage
platformPlatform
configConfiguration<IDatabaseDriver<Connection>>

Returns: ObjectHydrator

Inherited from: Hydrator

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

Properties#

config#

Protected Readonly config: Configuration<IDatabaseDriver<Connection>>

Inherited from: Hydrator.config


hydrators#

Private Readonly hydrators: object

Type declaration:#

NameType
fullMap<string, EntityHydrator<any>>
referenceMap<string, EntityHydrator<any>>
returningMap<string, EntityHydrator<any>>

Defined in: packages/core/src/hydration/ObjectHydrator.ts:13


metadata#

Protected Readonly metadata: MetadataStorage

Inherited from: Hydrator.metadata


platform#

Protected Readonly platform: Platform

Inherited from: Hydrator.platform

Methods#

createCollectionItemMapper#

PrivatecreateCollectionItemMapper<T>(prop: EntityProperty<any>): string[]

Type parameters:#

Name
T

Parameters:#

NameType
propEntityProperty<any>

Returns: string[]

Defined in: packages/core/src/hydration/ObjectHydrator.ts:263


getEntityHydrator#

PrivategetEntityHydrator<T>(meta: EntityMetadata<T>, type: reference | full | returning): EntityHydrator<T>

internal Highly performance-sensitive method.

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
typereference | full | returning

Returns: EntityHydrator<T>

Defined in: packages/core/src/hydration/ObjectHydrator.ts:38


getProperties#

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

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
typereference | full | returning

Returns: EntityProperty<T>[]

Inherited from: Hydrator

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


hydrate#

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

inheritdoc

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameTypeDefault value
entityT-
metaEntityMetadata<T>-
dataEntityData<T>-
factoryEntityFactory-
typereference | full | returning-
newEntitybooleanfalse
convertCustomTypesbooleanfalse

Returns: void

Overrides: Hydrator

Defined in: packages/core/src/hydration/ObjectHydrator.ts:22


hydrateProperty#

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

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

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

Returns: void

Inherited from: Hydrator

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


hydrateReference#

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

inheritdoc

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameTypeDefault value
entityT-
metaEntityMetadata<T>-
dataEntityData<T>-
factoryEntityFactory-
convertCustomTypesbooleanfalse

Returns: void

Overrides: Hydrator

Defined in: packages/core/src/hydration/ObjectHydrator.ts:30

Last updated on by Renovate Bot