UNPKG

1.47 kBTypeScriptView Raw
1import { RelationCountMetadataArgs } from "../metadata-args/RelationCountMetadataArgs";
2import { EntityMetadata } from "./EntityMetadata";
3import { RelationMetadata } from "./RelationMetadata";
4import { SelectQueryBuilder } from "../query-builder/SelectQueryBuilder";
5/**
6 * Contains all information about entity's relation count.
7 */
8export declare class RelationCountMetadata {
9 /**
10 * Entity metadata where this column metadata is.
11 */
12 entityMetadata: EntityMetadata;
13 /**
14 * Relation which needs to be counted.
15 */
16 relation: RelationMetadata;
17 /**
18 * Relation name which need to count.
19 */
20 relationNameOrFactory: string | ((object: any) => any);
21 /**
22 * Target class to which metadata is applied.
23 */
24 target: Function | string;
25 /**
26 * Target's property name to which this metadata is applied.
27 */
28 propertyName: string;
29 /**
30 * Alias of the joined (destination) table.
31 */
32 alias?: string;
33 /**
34 * Extra condition applied to "ON" section of join.
35 */
36 queryBuilderFactory?: (qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>;
37 constructor(options: {
38 entityMetadata: EntityMetadata;
39 args: RelationCountMetadataArgs;
40 });
41 /**
42 * Builds some depend relation count metadata properties.
43 * This builder method should be used only after entity metadata, its properties map and all relations are build.
44 */
45 build(): void;
46}