Skip to main content
Version: 4.5

Class: ChangeSetPersister#

core.ChangeSetPersister

Constructors#

constructor#

+ new ChangeSetPersister(driver: IDatabaseDriver<Connection>, metadata: MetadataStorage, hydrator: IHydrator, factory: EntityFactory, config: Configuration<IDatabaseDriver<Connection>>): ChangeSetPersister

Parameters:#

NameType
driverIDatabaseDriver<Connection>
metadataMetadataStorage
hydratorIHydrator
factoryEntityFactory
configConfiguration<IDatabaseDriver<Connection>>

Returns: ChangeSetPersister

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:12

Properties#

platform#

Private Readonly platform: Platform

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:12

Methods#

checkOptimisticLock#

PrivatecheckOptimisticLock<T>(meta: EntityMetadata<T>, changeSet: ChangeSet<T>, res?: QueryResult): void

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
changeSetChangeSet<T>
res?QueryResult

Returns: void

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:211


checkOptimisticLocks#

PrivatecheckOptimisticLocks<T>(meta: EntityMetadata<T>, changeSets: ChangeSet<T>[], ctx?: any): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
changeSetsChangeSet<T>[]
ctx?any

Returns: Promise<void>

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:192


executeDeletes#

executeDeletes<T>(changeSets: ChangeSet<T>[], ctx?: any): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
changeSetsChangeSet<T>[]
ctx?any

Returns: Promise<void>

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:46


executeInserts#

executeInserts<T>(changeSets: ChangeSet<T>[], ctx?: any): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
changeSetsChangeSet<T>[]
ctx?any

Returns: Promise<void>

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:20


executeUpdates#

executeUpdates<T>(changeSets: ChangeSet<T>[], batched: boolean, ctx?: any): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
changeSetsChangeSet<T>[]
batchedboolean
ctx?any

Returns: Promise<void>

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:33


mapPrimaryKey#

PrivatemapPrimaryKey<T>(meta: EntityMetadata<T>, value: IPrimaryKeyValue, changeSet: ChangeSet<T>): void

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
valueIPrimaryKeyValue
changeSetChangeSet<T>

Returns: void

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:142


mapReturnedValues#

PrivatemapReturnedValues<T>(changeSet: ChangeSet<T>, res: QueryResult, meta: EntityMetadata<T>): void

Maps values returned via returning statement (postgres) or the inserted id (other sql drivers). No need to handle composite keys here as they need to be set upfront. We do need to map to the change set payload too, as it will be used in the originalEntityData for new entities.

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
changeSetChangeSet<T>
resQueryResult
metaEntityMetadata<T>

Returns: void

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:273


markAsPopulated#

PrivatemarkAsPopulated<T>(changeSet: ChangeSet<T>, meta: EntityMetadata<T>): void

Sets populate flag to new entities so they are serialized like if they were loaded from the db

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
changeSetChangeSet<T>
metaEntityMetadata<T>

Returns: void

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:162


persistManagedEntities#

PrivatepersistManagedEntities<T>(meta: EntityMetadata<T>, changeSets: ChangeSet<T>[], ctx?: any): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
changeSetsChangeSet<T>[]
ctx?any

Returns: Promise<void>

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:126


persistManagedEntitiesBatch#

PrivatepersistManagedEntitiesBatch<T>(meta: EntityMetadata<T>, changeSets: ChangeSet<T>[], ctx?: any): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
changeSetsChangeSet<T>[]
ctx?any

Returns: Promise<void>

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:136


persistManagedEntity#

PrivatepersistManagedEntity<T>(changeSet: ChangeSet<T>, ctx?: any): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
changeSetChangeSet<T>
ctx?any

Returns: Promise<void>

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:118


persistNewEntities#

PrivatepersistNewEntities<T>(meta: EntityMetadata<T>, changeSets: ChangeSet<T>[], ctx?: any): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
changeSetsChangeSet<T>[]
ctx?any

Returns: Promise<void>

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:86


persistNewEntitiesBatch#

PrivatepersistNewEntitiesBatch<T>(meta: EntityMetadata<T>, changeSets: ChangeSet<T>[], ctx?: any): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
changeSetsChangeSet<T>[]
ctx?any

Returns: Promise<void>

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:99


persistNewEntity#

PrivatepersistNewEntity<T>(meta: EntityMetadata<T>, changeSet: ChangeSet<T>, ctx?: any): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
changeSetChangeSet<T>
ctx?any

Returns: Promise<void>

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:66


processProperties#

PrivateprocessProperties<T>(changeSet: ChangeSet<T>): void

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
changeSetChangeSet<T>

Returns: void

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:58


processProperty#

PrivateprocessProperty<T>(changeSet: ChangeSet<T>, prop: EntityProperty<T>): void

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
changeSetChangeSet<T>
propEntityProperty<T>

Returns: void

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:244


reloadVersionValues#

PrivatereloadVersionValues<T>(meta: EntityMetadata<T>, changeSets: ChangeSet<T>[], ctx?: any): Promise<void>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
changeSetsChangeSet<T>[]
ctx?any

Returns: Promise<void>

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:217


updateEntity#

PrivateupdateEntity<T>(meta: EntityMetadata<T>, changeSet: ChangeSet<T>, ctx?: any): Promise<QueryResult>

Type parameters:#

NameType
TAnyEntity<T>

Parameters:#

NameType
metaEntityMetadata<T>
changeSetChangeSet<T>
ctx?any

Returns: Promise<QueryResult>

Defined in: packages/core/src/unit-of-work/ChangeSetPersister.ts:179

Last updated on by Renovate Bot