Skip to main content
Version: 4.4

Class: EntityAssigner#

core.EntityAssigner

Hierarchy#

  • EntityAssigner

Constructors#

constructor#

+ new EntityAssigner(): EntityAssigner

Returns: EntityAssigner

Methods#

assign#

Staticassign<T>(entity: T, data: EntityData<T>, options?: AssignOptions): T

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
entityT
dataEntityData<T>
options?AssignOptions

Returns: T

Defined in: packages/core/src/entity/EntityAssigner.ts:14

Staticassign<T>(entity: T, data: EntityData<T>, onlyProperties?: boolean): T

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
entityT
dataEntityData<T>
onlyProperties?boolean

Returns: T

Defined in: packages/core/src/entity/EntityAssigner.ts:15


assignCollection#

Private StaticassignCollection<T, U>(entity: T, collection: Collection<U, unknown>, value: any[], prop: EntityProperty<any>, em: EntityManager<IDatabaseDriver<Connection>>, options: AssignOptions): void

Type parameters:#

NameTypeDefault
TAnyEntity<T>-
UAnyEntity<U>AnyEntity<any\>

Parameters:#

NameType
entityT
collectionCollection<U, unknown>
valueany[]
propEntityProperty<any>
emEntityManager<IDatabaseDriver<Connection>>
optionsAssignOptions

Returns: void

Defined in: packages/core/src/entity/EntityAssigner.ts:111


assignEmbeddable#

Private StaticassignEmbeddable<T>(entity: T, value: any, prop: EntityProperty<any>, em: EntityManager<IDatabaseDriver<Connection>>, options: AssignOptions): void

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
entityT
valueany
propEntityProperty<any>
emEntityManager<IDatabaseDriver<Connection>>
optionsAssignOptions

Returns: void

Defined in: packages/core/src/entity/EntityAssigner.ts:123


assignReference#

Private StaticassignReference<T>(entity: T, value: any, prop: EntityProperty<any>, em: EntityManager<IDatabaseDriver<Connection>>, options: AssignOptions): void

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
entityT
valueany
propEntityProperty<any>
emEntityManager<IDatabaseDriver<Connection>>
optionsAssignOptions

Returns: void

Defined in: packages/core/src/entity/EntityAssigner.ts:94


autoWireOneToOne#

StaticautoWireOneToOne<T>(prop: EntityProperty<any>, entity: T): void

auto-wire 1:1 inverse side with owner as in no-sql drivers it can't be joined also makes sure the link is bidirectional when creating new entities from nested structures

internal

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
propEntityProperty<any>
entityT

Returns: void

Defined in: packages/core/src/entity/EntityAssigner.ts:68


createCollectionItem#

Private StaticcreateCollectionItem<T>(item: any, em: EntityManager<IDatabaseDriver<Connection>>, prop: EntityProperty<any>, invalid: any[], options: AssignOptions): T

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
itemany
emEntityManager<IDatabaseDriver<Connection>>
propEntityProperty<any>
invalidany[]
optionsAssignOptions

Returns: T

Defined in: packages/core/src/entity/EntityAssigner.ts:139


validateEM#

Private StaticvalidateEM(em?: EntityManager<IDatabaseDriver<Connection>>): boolean

Parameters:#

NameType
em?EntityManager<IDatabaseDriver<Connection>>

Returns: boolean

Defined in: packages/core/src/entity/EntityAssigner.ts:86

Last updated on by Martin Adámek