Skip to main content
Version: 4.4

Class: WrappedEntity<T, PK>#

core.WrappedEntity

Type parameters#

NameType
TAnyEntity<T>
PKkeyof T

Hierarchy#

  • WrappedEntity

Constructors#

constructor#

+ new WrappedEntity<T, PK>(entity: T, pkGetter: (e: T) => Primary<T>, pkSerializer: (e: T) => string): WrappedEntity<T, PK>

Type parameters:#

NameType
TAnyEntity<T>
PKstring | number | symbol

Parameters:#

NameType
entityT
pkGetter(e: T) => Primary<T>
pkSerializer(e: T) => string

Returns: WrappedEntity<T, PK>

Defined in: packages/core/src/entity/WrappedEntity.ts:24

Properties#

__em#

Optional __em: undefined | EntityManager<IDatabaseDriver<Connection>>

Defined in: packages/core/src/entity/WrappedEntity.ts:17


__identifier#

Optional __identifier: undefined | EntityData<T>

holds wrapped primary key so we can compute change set without eager commit

Defined in: packages/core/src/entity/WrappedEntity.ts:24


__initialized#

__initialized: boolean= true

Defined in: packages/core/src/entity/WrappedEntity.ts:13


__lazyInitialized#

Optional __lazyInitialized: undefined | boolean

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


__managed#

Optional __managed: undefined | boolean

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


__originalEntityData#

Optional __originalEntityData: undefined | EntityData<T>

holds last entity data snapshot so we can compute changes when persisting managed entities

Defined in: packages/core/src/entity/WrappedEntity.ts:21


__populated#

Optional __populated: undefined | boolean

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


__serializationContext#

__serializationContext: { populate?: undefined | PopulateOptions<T>[] ; root?: undefined | SerializationContext<T> }

Type declaration:#

NameType
populate?undefined | PopulateOptions<T>[]
root?undefined | SerializationContext<T>

Defined in: packages/core/src/entity/WrappedEntity.ts:18

Accessors#

__meta#

__meta(): EntityMetadata<T>

Returns: EntityMetadata<T>

Defined in: packages/core/src/entity/WrappedEntity.ts:93


__platform#

__platform(): Platform

Returns: Platform

Defined in: packages/core/src/entity/WrappedEntity.ts:97


__primaryKeyCond#

__primaryKeyCond(): null | Primary<T> | Primary<T>[]

Returns: null | Primary<T> | Primary<T>[]

Defined in: packages/core/src/entity/WrappedEntity.ts:105


__primaryKeys#

__primaryKeys(): Primary<T>[]

Returns: Primary<T>[]

Defined in: packages/core/src/entity/WrappedEntity.ts:101

Methods#

__@custom@36825#

__@custom@36825(): string

Returns: string

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


assign#

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

Parameters:#

NameType
dataEntityData<T>
options?AssignOptions

Returns: T

Defined in: packages/core/src/entity/WrappedEntity.ts:56


getPrimaryKey#

getPrimaryKey(): null | Primary<T>

Returns: null | Primary<T>

Defined in: packages/core/src/entity/WrappedEntity.ts:81


getSerializedPrimaryKey#

getSerializedPrimaryKey(): string

Returns: string

Defined in: packages/core/src/entity/WrappedEntity.ts:89


hasPrimaryKey#

hasPrimaryKey(): boolean

Returns: boolean

Defined in: packages/core/src/entity/WrappedEntity.ts:76


init#

init<P>(populated?: boolean, populate?: P, lockMode?: NONE | OPTIMISTIC | PESSIMISTIC_READ | PESSIMISTIC_WRITE): Promise<T>

Type parameters:#

NameTypeDefault
PPopulate<T>Populate<T\>

Parameters:#

NameTypeDefault value
populatedbooleantrue
populate?P-
lockMode?NONE | OPTIMISTIC | PESSIMISTIC_READ | PESSIMISTIC_WRITE-

Returns: Promise<T>

Defined in: packages/core/src/entity/WrappedEntity.ts:64


isInitialized#

isInitialized(): boolean

Returns: boolean

Defined in: packages/core/src/entity/WrappedEntity.ts:30


populated#

populated(populated?: boolean): void

Parameters:#

NameTypeDefault value
populatedbooleantrue

Returns: void

Defined in: packages/core/src/entity/WrappedEntity.ts:34


setPrimaryKey#

setPrimaryKey(id: null | Primary<T>): void

Parameters:#

NameType
idnull | Primary<T>

Returns: void

Defined in: packages/core/src/entity/WrappedEntity.ts:85


toJSON#

toJSON(...args: any[]): EntityData<T>

Parameters:#

NameType
...argsany[]

Returns: EntityData<T>

Defined in: packages/core/src/entity/WrappedEntity.ts:51


toObject#

toObject(ignoreFields?: string[]): EntityData<T>

Parameters:#

NameTypeDefault value
ignoreFieldsstring[]...

Returns: EntityData<T>

Defined in: packages/core/src/entity/WrappedEntity.ts:43


toPOJO#

toPOJO(): EntityData<T>

Returns: EntityData<T>

Defined in: packages/core/src/entity/WrappedEntity.ts:47


toReference#

toReference(): IdentifiedReference<T, PK>

Returns: IdentifiedReference<T, PK>

Defined in: packages/core/src/entity/WrappedEntity.ts:39

Last updated on by renovate[bot]