7
7
"manyToOneRelation"."test_entity_id" AS "manyToOneRelation_test_entity_id",
8
8
"manyToOneRelation"."uni_directional_test_entity_id" AS "manyToOneRelation_uni_directional_test_entity_id",
9
9
"manyToOneRelation"."uni_directional_relation_test_entity_id" AS "manyToOneRelation_uni_directional_relation_test_entity_id",
10
- "TestEntity "."test_entity_pk" AS "TestEntity_test_entity_pk "
10
+ "test_entity "."test_entity_pk" AS "test_entity_testEntityPk "
11
11
FROM
12
12
"test_relation" "manyToOneRelation"
13
- LEFT JOIN "test_entity" "TestEntity " ON "TestEntity "."many_to_one_relation_id" = "manyToOneRelation"."test_relation_pk"
13
+ INNER JOIN "test_entity" "test_entity " ON "test_entity "."many_to_one_relation_id" = "manyToOneRelation"."test_relation_pk"
14
14
WHERE
15
- "TestEntity"."test_entity_pk" IN (test-entity-id-1, test-entity-id-2)
15
+ "test_entity"."test_entity_pk" IN (test-entity-id-1, test-entity-id-2)
16
+ ` ;
17
+
18
+ exports [` RelationQueryBuilder #batchSelect should reuse existing join alias if there is one 1` ] = `
19
+ SELECT
20
+ "manyToOneRelation"."test_relation_pk" AS "manyToOneRelation_test_relation_pk",
21
+ "manyToOneRelation"."relation_name" AS "manyToOneRelation_relation_name",
22
+ "manyToOneRelation"."test_entity_id" AS "manyToOneRelation_test_entity_id",
23
+ "manyToOneRelation"."uni_directional_test_entity_id" AS "manyToOneRelation_uni_directional_test_entity_id",
24
+ "manyToOneRelation"."uni_directional_relation_test_entity_id" AS "manyToOneRelation_uni_directional_relation_test_entity_id",
25
+ "testEntity"."test_entity_pk" AS "testEntity_testEntityPk"
26
+ FROM
27
+ "test_relation" "manyToOneRelation"
28
+ LEFT JOIN "test_entity" "testEntity" ON "testEntity"."test_entity_pk" = "manyToOneRelation"."test_entity_id"
29
+ WHERE
30
+ (("testEntity"."test_entity_pk" = test))
31
+ AND "testEntity"."test_entity_pk" IN (test-entity-1)
16
32
` ;
17
33
18
34
exports [` RelationQueryBuilder #select many to many many-to-many custom join table should work with a many-to-many through a join table 1` ] = `
@@ -86,9 +102,9 @@ SELECT
86
102
"testEntityUniDirectional"."oneTestRelationTestRelationPk" AS "testEntityUniDirectional_oneTestRelationTestRelationPk"
87
103
FROM
88
104
"test_entity" "testEntityUniDirectional"
89
- INNER JOIN "test_relation" "TestRelation " ON "TestRelation "."uni_directional_test_entity_id" = "testEntityUniDirectional"."test_entity_pk"
105
+ INNER JOIN "test_relation" "test_relation " ON "test_relation "."uni_directional_test_entity_id" = "testEntityUniDirectional"."test_entity_pk"
90
106
WHERE
91
- ("TestRelation "."test_relation_pk" = test-relation-id-1)
107
+ ("test_relation "."test_relation_pk" = test-relation-id-1)
92
108
` ;
93
109
94
110
exports [` RelationQueryBuilder #select many to one should work with one entity 1` ] = `
@@ -102,9 +118,9 @@ SELECT
102
118
"testEntity"."oneTestRelationTestRelationPk" AS "testEntity_oneTestRelationTestRelationPk"
103
119
FROM
104
120
"test_entity" "testEntity"
105
- INNER JOIN "test_relation" "TestRelation " ON "TestRelation "."test_entity_id" = "testEntity"."test_entity_pk"
121
+ INNER JOIN "test_relation" "test_relation " ON "test_relation "."test_entity_id" = "testEntity"."test_entity_pk"
106
122
WHERE
107
- ("TestRelation "."test_relation_pk" = test-relation-id-1)
123
+ ("test_relation "."test_relation_pk" = test-relation-id-1)
108
124
` ;
109
125
110
126
exports [` RelationQueryBuilder #select one to many should query with a single entity 1` ] = `
@@ -146,9 +162,9 @@ SELECT
146
162
"oneTestRelation"."uni_directional_relation_test_entity_id" AS "oneTestRelation_uni_directional_relation_test_entity_id"
147
163
FROM
148
164
"test_relation" "oneTestRelation"
149
- INNER JOIN "test_entity" "TestEntity " ON "TestEntity "."oneTestRelationTestRelationPk" = "oneTestRelation"."test_relation_pk"
165
+ INNER JOIN "test_entity" "test_entity " ON "test_entity "."oneTestRelationTestRelationPk" = "oneTestRelation"."test_relation_pk"
150
166
WHERE
151
- ("TestEntity "."test_entity_pk" = test-entity-id-1)
167
+ ("test_entity "."test_entity_pk" = test-entity-id-1)
152
168
` ;
153
169
154
170
exports [` RelationQueryBuilder #select with filter should call whereBuilder#build if there is a filter 1` ] = `
0 commit comments