@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.
27 lines (26 loc) • 1.16 kB
TypeScript
import { type Configuration } from '../utils';
import type { MetadataStorage } from '../metadata';
import type { AnyEntity } from '../typings';
import { ChangeSet } from './ChangeSet';
import { type Collection, type EntityValidator } from '../entity';
import type { Platform } from '../platforms';
import type { EntityManager } from '../EntityManager';
export declare class ChangeSetComputer {
private readonly validator;
private readonly collectionUpdates;
private readonly metadata;
private readonly platform;
private readonly config;
private readonly em;
private readonly comparator;
constructor(validator: EntityValidator, collectionUpdates: Set<Collection<AnyEntity>>, metadata: MetadataStorage, platform: Platform, config: Configuration, em: EntityManager);
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;
}