Skip to main content
Version: 4.5

Class: EntityHelper#

core.EntityHelper

Constructors#

constructor#

+ new EntityHelper(): EntityHelper

Returns: EntityHelper

Methods#

decorate#

Staticdecorate<T>(meta: EntityMetadata<T>, em: EntityManager<IDatabaseDriver<Connection>>): void

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
emEntityManager<IDatabaseDriver<Connection>>

Returns: void

Defined in: packages/core/src/entity/EntityHelper.ts:16


defineBaseProperties#

Private StaticdefineBaseProperties<T>(meta: EntityMetadata<T>, prototype: T, em: EntityManager<IDatabaseDriver<Connection>>): void

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
prototypeT
emEntityManager<IDatabaseDriver<Connection>>

Returns: void

Defined in: packages/core/src/entity/EntityHelper.ts:55


defineIdProperty#

Private StaticdefineIdProperty<T>(meta: EntityMetadata<T>, platform: Platform): void

defines magic id property getter/setter if PK property is _id and there is no id property defined

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
platformPlatform

Returns: void

Defined in: packages/core/src/entity/EntityHelper.ts:44


defineReferenceProperties#

Private StaticdefineReferenceProperties<T>(meta: EntityMetadata<T>): void

Defines getter and setter for every owning side of m:1 and 1:1 relation. This is then used for propagation of changes to the inverse side of bi-directional relations. First defines a setter on the prototype, once called, actual get/set handlers are registered on the instance rather than on its prototype. Thanks to this we still have those properties enumerable (e.g. part of Object.keys(entity)).

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>

Returns: void

Defined in: packages/core/src/entity/EntityHelper.ts:79


defineReferenceProperty#

Private StaticdefineReferenceProperty<T>(prop: EntityProperty<T>, ref: T, val: AnyEntity<any>): void

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
propEntityProperty<T>
refT
valAnyEntity<any>

Returns: void

Defined in: packages/core/src/entity/EntityHelper.ts:113


propagate#

Private Staticpropagate<T, O>(entity: T, owner: O, prop: EntityProperty<O>): void

Type parameters:#

NameType
TAnyEntity<T>
OAnyEntity<O>

Parameters:#

NameType
entityT
ownerO
propEntityProperty<O>

Returns: void

Defined in: packages/core/src/entity/EntityHelper.ts:129


propagateOneToOne#

Private StaticpropagateOneToOne<T, O>(entity: T, owner: O, prop: EntityProperty<O>): void

Type parameters:#

Name
T
O

Parameters:#

NameType
entityT
ownerO
propEntityProperty<O>

Returns: void

Defined in: packages/core/src/entity/EntityHelper.ts:141

Last updated on by Renovate Bot