Skip to main content
Module

x/typeorm/src/index.ts>EntityManager#preload

Forked from https://github.com/typeorm/typeorm
Latest
method EntityManager.prototype.preload
Re-export
import { EntityManager } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/index.ts";

Creates a new entity from the given plan javascript object. If entity already exist in the database, then it loads it (and everything related to it), replaces all values with the new ones from the given object and returns this new entity. This new entity is actually a loaded from the db entity with all properties replaced from the new object.

Parameters

entityClass: ObjectType<Entity>
entityLike: DeepPartial<Entity>

Returns

Promise<Entity | undefined>

Creates a new entity from the given plan javascript object. If entity already exist in the database, then it loads it (and everything related to it), replaces all values with the new ones from the given object and returns this new entity. This new entity is actually a loaded from the db entity with all properties replaced from the new object.

Parameters

entitySchema: EntitySchema<Entity>
entityLike: DeepPartial<Entity>

Returns

Promise<Entity | undefined>

Creates a new entity from the given plan javascript object. If entity already exist in the database, then it loads it (and everything related to it), replaces all values with the new ones from the given object and returns this new entity. This new entity is actually a loaded from the db entity with all properties replaced from the new object.

Parameters

entityName: string
entityLike: DeepPartial<any>

Returns

Promise<any | undefined>