@mikro-orm/core
Version:
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.
20 lines (19 loc) • 893 B
TypeScript
import type { AnyEntity } from '../typings.js';
import { ChangeSet } from './ChangeSet.js';
import { type Collection } from '../entity/Collection.js';
import type { EntityManager } from '../EntityManager.js';
/** @internal Computes change sets by comparing entity state against original snapshots. */
export declare class ChangeSetComputer {
#private;
constructor(em: EntityManager, collectionUpdates: Set<Collection<AnyEntity>>);
/** Computes a change set for the given entity by diffing against its original state. */
computeChangeSet<T extends object>(entity: T): ChangeSet<T> | null;
/**
* Traverses entity graph and executes `onCreate` and `onUpdate` methods, assigning the values to given properties.
*/
private processPropertyInitializers;
private computePayload;
private processProperty;
private processToOne;
private processToMany;
}