Skip to main content
Module

x/typeorm/src/query-builder/RelationIdLoader.ts>RelationIdLoader

Forked from https://github.com/typeorm/typeorm
Latest
class RelationIdLoader
import { RelationIdLoader } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/query-builder/RelationIdLoader.ts";

Loads relation ids for the given entities.

Constructors

new
RelationIdLoader(connection: Connection)

Methods

protected
loadForManyToMany(
relation: RelationMetadata,
entities: ObjectLiteral[],
relatedEntities?: ObjectLiteral[],
)

Loads relation ids for the many-to-many relation.

protected
loadForManyToOneAndOneToOneOwner(
relation: RelationMetadata,
entities: ObjectLiteral[],
relatedEntities?: ObjectLiteral[],
)

Loads relation ids for the many-to-one and one-to-one owner relations.

protected
loadForOneToManyAndOneToOneNotOwner(
relation: RelationMetadata,
entities: ObjectLiteral[],
relatedEntities?: ObjectLiteral[],
)

Loads relation ids for the one-to-many and one-to-one not owner relations.

load(
target: Function | string,
relation: string,
entities: ObjectLiteral | ObjectLiteral[],
relatedEntities?: ObjectLiteral | ObjectLiteral[],
): Promise<any[]>

Loads relation ids of the given entity or entities.

load(
relation: RelationMetadata,
entities: ObjectLiteral | ObjectLiteral[],
relatedEntities?: ObjectLiteral | ObjectLiteral[],
): Promise<any[]>

Loads relation ids of the given entity or entities.

loadManyToManyRelationIdsAndGroup<E1, E2>(
relation: RelationMetadata,
entitiesOrEntities: E1 | E1[],
relatedEntityOrEntities?: E2 | E2[],
): Promise<{ entity: E1; related?: E2 | E2[]; }[]>

Loads relation ids of the given entities and groups them into the object with parent and children.

todo: extract this method?