UNPKG

3 kBTypeScriptView Raw
1import { EntityMetadata } from "../metadata/EntityMetadata";
2import { Connection } from "../connection/Connection";
3import { RelationMetadata } from "../metadata/RelationMetadata";
4import { QueryExpressionMap } from "./QueryExpressionMap";
5import { Alias } from "./Alias";
6/**
7 * Stores all join attributes which will be used to build a JOIN query.
8 */
9export declare class JoinAttribute {
10 private connection;
11 private queryExpressionMap;
12 /**
13 * Join direction.
14 */
15 direction: "LEFT" | "INNER";
16 /**
17 * Alias of the joined (destination) table.
18 */
19 alias: Alias;
20 /**
21 * Joined table, entity target, or relation in "post.category" format.
22 */
23 entityOrProperty: Function | string;
24 /**
25 * Extra condition applied to "ON" section of join.
26 */
27 condition?: string;
28 /**
29 * Property + alias of the object where to joined data should be mapped.
30 */
31 mapToProperty?: string;
32 /**
33 * Indicates if user maps one or many objects from the join.
34 */
35 isMappingMany?: boolean;
36 constructor(connection: Connection, queryExpressionMap: QueryExpressionMap, joinAttribute?: JoinAttribute);
37 readonly isMany: boolean;
38 isSelectedCache: boolean;
39 isSelectedEvalueated: boolean;
40 /**
41 * Indicates if this join is selected.
42 */
43 readonly isSelected: boolean;
44 /**
45 * Name of the table which we should join.
46 */
47 readonly tablePath: string;
48 /**
49 * Alias of the parent of this join.
50 * For example, if we join ("post.category", "categoryAlias") then "post" is a parent alias.
51 * This value is extracted from entityOrProperty value.
52 * This is available when join was made using "post.category" syntax.
53 */
54 readonly parentAlias: string | undefined;
55 /**
56 * Relation property name of the parent.
57 * This is used to understand what is joined.
58 * For example, if we join ("post.category", "categoryAlias") then "category" is a relation property.
59 * This value is extracted from entityOrProperty value.
60 * This is available when join was made using "post.category" syntax.
61 */
62 readonly relationPropertyPath: string | undefined;
63 relationCache: RelationMetadata | undefined;
64 relationEvalueated: boolean;
65 /**
66 * Relation of the parent.
67 * This is used to understand what is joined.
68 * This is available when join was made using "post.category" syntax.
69 * Relation can be undefined if entityOrProperty is regular entity or custom table.
70 */
71 readonly relation: RelationMetadata | undefined;
72 /**
73 * Metadata of the joined entity.
74 * If table without entity was joined, then it will return undefined.
75 */
76 readonly metadata: EntityMetadata | undefined;
77 /**
78 * Generates alias of junction table, whose ids we get.
79 */
80 readonly junctionAlias: string;
81 readonly mapToPropertyParentAlias: string | undefined;
82 readonly mapToPropertyPropertyName: string | undefined;
83}