Version: 4.3

Class: EntityHelper

Hierarchy

  • EntityHelper

Methods

decorate

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

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

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
metaEntityMetadata<T>
emEntityManager

Returns: void


defineBaseProperties

Static PrivatedefineBaseProperties<T>(meta: EntityMetadata<T>, prototype: T, em: EntityManager): void

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

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
metaEntityMetadata<T>
prototypeT
emEntityManager

Returns: void


defineIdProperty

Static PrivatedefineIdProperty<T>(meta: EntityMetadata<T>, platform: Platform): void

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

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


defineReferenceProperties

Static PrivatedefineReferenceProperties<T>(meta: EntityMetadata<T>): void

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

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


defineReferenceProperty

Static PrivatedefineReferenceProperty<T>(prop: EntityProperty<T>, ref: T, val: AnyEntity): void

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

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
propEntityProperty<T>
refT
valAnyEntity

Returns: void


propagate

Static Privatepropagate<T, O>(entity: T, owner: O, prop: EntityProperty<O>): void

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

Type parameters:

NameType
TAnyEntity<T>
OAnyEntity<O>

Parameters:

NameType
entityT
ownerO
propEntityProperty<O>

Returns: void


propagateOneToOne

Static PrivatepropagateOneToOne<T, O>(entity: T, owner: O, prop: EntityProperty<O>): void

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

Type parameters:

Name
T
O

Parameters:

NameType
entityT
ownerO
propEntityProperty<O>

Returns: void

Last updated on by Martin Adámek