Update tests

7.0-servicing
Christopher Jolly 2 years ago
parent db7a513b64
commit 6f38fe6e90

@ -27,9 +27,9 @@ public class EntitySplittingQueryJetTest : EntitySplittingQueryTestBase
AssertSql(
"""
SELECT [e].[Id], [e].[EntityThreeId], [e].[IntValue1], [e].[IntValue2], [s].[IntValue3], [s].[IntValue4], [e].[StringValue1], [e].[StringValue2], [s].[StringValue3], [s].[StringValue4]
FROM [EntityOne] AS [e]
INNER JOIN [SplitEntityOnePart] AS [s] ON [e].[Id] = [s].[Id]
SELECT `e`.`Id`, `e`.`EntityThreeId`, `e`.`IntValue1`, `e`.`IntValue2`, `s`.`IntValue3`, `s`.`IntValue4`, `e`.`StringValue1`, `e`.`StringValue2`, `s`.`StringValue3`, `s`.`StringValue4`
FROM `EntityOne` AS `e`
INNER JOIN `SplitEntityOnePart` AS `s` ON `e`.`Id` = `s`.`Id`
""");
}
@ -39,8 +39,8 @@ INNER JOIN [SplitEntityOnePart] AS [s] ON [e].[Id] = [s].[Id]
AssertSql(
"""
SELECT [e].[Id], [e].[IntValue1], [e].[StringValue1]
FROM [EntityOne] AS [e]
SELECT `e`.`Id`, `e`.`IntValue1`, `e`.`StringValue1`
FROM `EntityOne` AS `e`
""");
}
@ -50,10 +50,10 @@ FROM [EntityOne] AS [e]
AssertSql(
"""
SELECT [e].[Id], [e].[EntityThreeId], [e].[IntValue1], [e].[IntValue2], [s0].[IntValue3], [s].[IntValue4], [e].[StringValue1], [e].[StringValue2], [s0].[StringValue3], [s].[StringValue4]
FROM [EntityOne] AS [e]
INNER JOIN [SplitEntityOnePart3] AS [s] ON [e].[Id] = [s].[Id]
INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e].[Id] = [s0].[Id]
SELECT `e`.`Id`, `e`.`EntityThreeId`, `e`.`IntValue1`, `e`.`IntValue2`, `s0`.`IntValue3`, `s`.`IntValue4`, `e`.`StringValue1`, `e`.`StringValue2`, `s0`.`StringValue3`, `s`.`StringValue4`
FROM (`EntityOne` AS `e`
INNER JOIN `SplitEntityOnePart3` AS `s` ON `e`.`Id` = `s`.`Id`)
INNER JOIN `SplitEntityOnePart2` AS `s0` ON `e`.`Id` = `s0`.`Id`
""");
}
@ -63,9 +63,9 @@ INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e].[Id] = [s0].[Id]
AssertSql(
"""
SELECT [e].[Id], [s0].[IntValue3], [s0].[StringValue3]
FROM [EntityOne] AS [e]
INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e].[Id] = [s0].[Id]
SELECT `e`.`Id`, `s0`.`IntValue3`, `s0`.`StringValue3`
FROM `EntityOne` AS `e`
INNER JOIN `SplitEntityOnePart2` AS `s0` ON `e`.`Id` = `s0`.`Id`
""");
}
@ -75,9 +75,9 @@ INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e].[Id] = [s0].[Id]
AssertSql(
"""
SELECT [e].[Id], [s].[IntValue4], [s].[StringValue4]
FROM [EntityOne] AS [e]
INNER JOIN [SplitEntityOnePart3] AS [s] ON [e].[Id] = [s].[Id]
SELECT `e`.`Id`, `s`.`IntValue4`, `s`.`StringValue4`
FROM `EntityOne` AS `e`
INNER JOIN `SplitEntityOnePart3` AS `s` ON `e`.`Id` = `s`.`Id`
""");
}
@ -87,14 +87,14 @@ INNER JOIN [SplitEntityOnePart3] AS [s] ON [e].[Id] = [s].[Id]
AssertSql(
"""
SELECT [e].[Id], [e].[EntityOneId], [e].[Name], [t].[Id], [t].[EntityThreeId], [t].[IntValue1], [t].[IntValue2], [t].[IntValue3], [t].[IntValue4], [t].[StringValue1], [t].[StringValue2], [t].[StringValue3], [t].[StringValue4]
FROM [EntityTwo] AS [e]
SELECT `e`.`Id`, `e`.`EntityOneId`, `e`.`Name`, `t`.`Id`, `t`.`EntityThreeId`, `t`.`IntValue1`, `t`.`IntValue2`, `t`.`IntValue3`, `t`.`IntValue4`, `t`.`StringValue1`, `t`.`StringValue2`, `t`.`StringValue3`, `t`.`StringValue4`
FROM `EntityTwo` AS `e`
LEFT JOIN (
SELECT [e0].[Id], [e0].[EntityThreeId], [e0].[IntValue1], [e0].[IntValue2], [s0].[IntValue3], [s].[IntValue4], [e0].[StringValue1], [e0].[StringValue2], [s0].[StringValue3], [s].[StringValue4]
FROM [EntityOne] AS [e0]
INNER JOIN [SplitEntityOnePart3] AS [s] ON [e0].[Id] = [s].[Id]
INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e0].[Id] = [s0].[Id]
) AS [t] ON [e].[EntityOneId] = [t].[Id]
SELECT `e0`.`Id`, `e0`.`EntityThreeId`, `e0`.`IntValue1`, `e0`.`IntValue2`, `s0`.`IntValue3`, `s`.`IntValue4`, `e0`.`StringValue1`, `e0`.`StringValue2`, `s0`.`StringValue3`, `s`.`StringValue4`
FROM (`EntityOne` AS `e0`
INNER JOIN `SplitEntityOnePart3` AS `s` ON `e0`.`Id` = `s`.`Id`)
INNER JOIN `SplitEntityOnePart2` AS `s0` ON `e0`.`Id` = `s0`.`Id`
) AS `t` ON `e`.`EntityOneId` = `t`.`Id`
""");
}
@ -104,15 +104,15 @@ LEFT JOIN (
AssertSql(
"""
SELECT [e].[Id], [e].[Name], [t].[Id], [t].[EntityThreeId], [t].[IntValue1], [t].[IntValue2], [t].[IntValue3], [t].[IntValue4], [t].[StringValue1], [t].[StringValue2], [t].[StringValue3], [t].[StringValue4]
FROM [EntityThree] AS [e]
SELECT `e`.`Id`, `e`.`Name`, `t`.`Id`, `t`.`EntityThreeId`, `t`.`IntValue1`, `t`.`IntValue2`, `t`.`IntValue3`, `t`.`IntValue4`, `t`.`StringValue1`, `t`.`StringValue2`, `t`.`StringValue3`, `t`.`StringValue4`
FROM `EntityThree` AS `e`
LEFT JOIN (
SELECT [e0].[Id], [e0].[EntityThreeId], [e0].[IntValue1], [e0].[IntValue2], [s0].[IntValue3], [s].[IntValue4], [e0].[StringValue1], [e0].[StringValue2], [s0].[StringValue3], [s].[StringValue4]
FROM [EntityOne] AS [e0]
INNER JOIN [SplitEntityOnePart3] AS [s] ON [e0].[Id] = [s].[Id]
INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e0].[Id] = [s0].[Id]
) AS [t] ON [e].[Id] = [t].[EntityThreeId]
ORDER BY [e].[Id]
SELECT `e0`.`Id`, `e0`.`EntityThreeId`, `e0`.`IntValue1`, `e0`.`IntValue2`, `s0`.`IntValue3`, `s`.`IntValue4`, `e0`.`StringValue1`, `e0`.`StringValue2`, `s0`.`StringValue3`, `s`.`StringValue4`
FROM (`EntityOne` AS `e0`
INNER JOIN `SplitEntityOnePart3` AS `s` ON `e0`.`Id` = `s`.`Id`)
INNER JOIN `SplitEntityOnePart2` AS `s0` ON `e0`.`Id` = `s0`.`Id`
) AS `t` ON `e`.`Id` = `t`.`EntityThreeId`
ORDER BY `e`.`Id`
""");
}
@ -122,15 +122,15 @@ ORDER BY [e].[Id]
AssertSql(
"""
SELECT [e].[Id], [e].[EntityOneId], [e].[Name], [t].[Id], [t].[EntityThreeId], [t].[IntValue1], [t].[IntValue2], [t].[IntValue3], [t].[IntValue4], [t].[StringValue1], [t].[StringValue2], [t].[StringValue3], [t].[StringValue4], [e1].[Id], [e1].[Name]
FROM [EntityTwo] AS [e]
SELECT `e`.`Id`, `e`.`EntityOneId`, `e`.`Name`, `t`.`Id`, `t`.`EntityThreeId`, `t`.`IntValue1`, `t`.`IntValue2`, `t`.`IntValue3`, `t`.`IntValue4`, `t`.`StringValue1`, `t`.`StringValue2`, `t`.`StringValue3`, `t`.`StringValue4`, `e1`.`Id`, `e1`.`Name`
FROM (`EntityTwo` AS `e`
LEFT JOIN (
SELECT [e0].[Id], [e0].[EntityThreeId], [e0].[IntValue1], [e0].[IntValue2], [s0].[IntValue3], [s].[IntValue4], [e0].[StringValue1], [e0].[StringValue2], [s0].[StringValue3], [s].[StringValue4]
FROM [EntityOne] AS [e0]
INNER JOIN [SplitEntityOnePart3] AS [s] ON [e0].[Id] = [s].[Id]
INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e0].[Id] = [s0].[Id]
) AS [t] ON [e].[EntityOneId] = [t].[Id]
LEFT JOIN [EntityThree] AS [e1] ON [t].[EntityThreeId] = [e1].[Id]
SELECT `e0`.`Id`, `e0`.`EntityThreeId`, `e0`.`IntValue1`, `e0`.`IntValue2`, `s0`.`IntValue3`, `s`.`IntValue4`, `e0`.`StringValue1`, `e0`.`StringValue2`, `s0`.`StringValue3`, `s`.`StringValue4`
FROM (`EntityOne` AS `e0`
INNER JOIN `SplitEntityOnePart3` AS `s` ON `e0`.`Id` = `s`.`Id`)
INNER JOIN `SplitEntityOnePart2` AS `s0` ON `e0`.`Id` = `s0`.`Id`
) AS `t` ON `e`.`EntityOneId` = `t`.`Id`)
LEFT JOIN `EntityThree` AS `e1` ON `t`.`EntityThreeId` = `e1`.`Id`
""");
}
@ -140,16 +140,16 @@ LEFT JOIN [EntityThree] AS [e1] ON [t].[EntityThreeId] = [e1].[Id]
AssertSql(
"""
SELECT [e].[Id], [e].[Name], [t].[Id], [t].[EntityThreeId], [t].[IntValue1], [t].[IntValue2], [t].[IntValue3], [t].[IntValue4], [t].[StringValue1], [t].[StringValue2], [t].[StringValue3], [t].[StringValue4], [t].[Id0], [t].[EntityOneId], [t].[Name]
FROM [EntityThree] AS [e]
SELECT `e`.`Id`, `e`.`Name`, `t`.`Id`, `t`.`EntityThreeId`, `t`.`IntValue1`, `t`.`IntValue2`, `t`.`IntValue3`, `t`.`IntValue4`, `t`.`StringValue1`, `t`.`StringValue2`, `t`.`StringValue3`, `t`.`StringValue4`, `t`.`Id0`, `t`.`EntityOneId`, `t`.`Name`
FROM `EntityThree` AS `e`
LEFT JOIN (
SELECT [e0].[Id], [e0].[EntityThreeId], [e0].[IntValue1], [e0].[IntValue2], [s0].[IntValue3], [s].[IntValue4], [e0].[StringValue1], [e0].[StringValue2], [s0].[StringValue3], [s].[StringValue4], [e1].[Id] AS [Id0], [e1].[EntityOneId], [e1].[Name]
FROM [EntityOne] AS [e0]
INNER JOIN [SplitEntityOnePart3] AS [s] ON [e0].[Id] = [s].[Id]
INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e0].[Id] = [s0].[Id]
LEFT JOIN [EntityTwo] AS [e1] ON [e0].[Id] = [e1].[EntityOneId]
) AS [t] ON [e].[Id] = [t].[EntityThreeId]
ORDER BY [e].[Id], [t].[Id]
SELECT `e0`.`Id`, `e0`.`EntityThreeId`, `e0`.`IntValue1`, `e0`.`IntValue2`, `s0`.`IntValue3`, `s`.`IntValue4`, `e0`.`StringValue1`, `e0`.`StringValue2`, `s0`.`StringValue3`, `s`.`StringValue4`, `e1`.`Id` AS `Id0`, `e1`.`EntityOneId`, `e1`.`Name`
FROM ((`EntityOne` AS `e0`
INNER JOIN `SplitEntityOnePart3` AS `s` ON `e0`.`Id` = `s`.`Id`)
INNER JOIN `SplitEntityOnePart2` AS `s0` ON `e0`.`Id` = `s0`.`Id`)
LEFT JOIN `EntityTwo` AS `e1` ON `e0`.`Id` = `e1`.`EntityOneId`
) AS `t` ON `e`.`Id` = `t`.`EntityThreeId`
ORDER BY `e`.`Id`, `t`.`Id`
""");
}
@ -159,11 +159,11 @@ ORDER BY [e].[Id], [t].[Id]
AssertSql(
"""
SELECT [e].[Id], [e].[EntityThreeId], [e].[IntValue1], [e].[IntValue2], [s0].[IntValue3], [s].[IntValue4], [e].[StringValue1], [e].[StringValue2], [s0].[StringValue3], [s].[StringValue4], [e0].[Id], [e0].[Name]
FROM [EntityOne] AS [e]
INNER JOIN [SplitEntityOnePart3] AS [s] ON [e].[Id] = [s].[Id]
INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e].[Id] = [s0].[Id]
LEFT JOIN [EntityThree] AS [e0] ON [e].[EntityThreeId] = [e0].[Id]
SELECT `e`.`Id`, `e`.`EntityThreeId`, `e`.`IntValue1`, `e`.`IntValue2`, `s0`.`IntValue3`, `s`.`IntValue4`, `e`.`StringValue1`, `e`.`StringValue2`, `s0`.`StringValue3`, `s`.`StringValue4`, `e0`.`Id`, `e0`.`Name`
FROM ((`EntityOne` AS `e`
INNER JOIN `SplitEntityOnePart3` AS `s` ON `e`.`Id` = `s`.`Id`)
INNER JOIN `SplitEntityOnePart2` AS `s0` ON `e`.`Id` = `s0`.`Id`)
LEFT JOIN `EntityThree` AS `e0` ON `e`.`EntityThreeId` = `e0`.`Id`
""");
}
@ -173,12 +173,12 @@ LEFT JOIN [EntityThree] AS [e0] ON [e].[EntityThreeId] = [e0].[Id]
AssertSql(
"""
SELECT [e].[Id], [e].[EntityThreeId], [e].[IntValue1], [e].[IntValue2], [s0].[IntValue3], [s].[IntValue4], [e].[StringValue1], [e].[StringValue2], [s0].[StringValue3], [s].[StringValue4], [e0].[Id], [e0].[EntityOneId], [e0].[Name]
FROM [EntityOne] AS [e]
INNER JOIN [SplitEntityOnePart3] AS [s] ON [e].[Id] = [s].[Id]
INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e].[Id] = [s0].[Id]
LEFT JOIN [EntityTwo] AS [e0] ON [e].[Id] = [e0].[EntityOneId]
ORDER BY [e].[Id]
SELECT `e`.`Id`, `e`.`EntityThreeId`, `e`.`IntValue1`, `e`.`IntValue2`, `s0`.`IntValue3`, `s`.`IntValue4`, `e`.`StringValue1`, `e`.`StringValue2`, `s0`.`StringValue3`, `s`.`StringValue4`, `e0`.`Id`, `e0`.`EntityOneId`, `e0`.`Name`
FROM ((`EntityOne` AS `e`
INNER JOIN `SplitEntityOnePart3` AS `s` ON `e`.`Id` = `s`.`Id`)
INNER JOIN `SplitEntityOnePart2` AS `s0` ON `e`.`Id` = `s0`.`Id`)
LEFT JOIN `EntityTwo` AS `e0` ON `e`.`Id` = `e0`.`EntityOneId`
ORDER BY `e`.`Id`
""");
}
@ -188,10 +188,10 @@ ORDER BY [e].[Id]
AssertSql(
"""
SELECT [e].[IntValue1], [s0].[IntValue3], [e0].[Id], [e0].[Name]
FROM [EntityOne] AS [e]
INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e].[Id] = [s0].[Id]
LEFT JOIN [EntityThree] AS [e0] ON [e].[EntityThreeId] = [e0].[Id]
SELECT `e`.`IntValue1`, `s0`.`IntValue3`, `e0`.`Id`, `e0`.`Name`
FROM (`EntityOne` AS `e`
INNER JOIN `SplitEntityOnePart2` AS `s0` ON `e`.`Id` = `s0`.`Id`)
LEFT JOIN `EntityThree` AS `e0` ON `e`.`EntityThreeId` = `e0`.`Id`
""");
}
@ -201,10 +201,10 @@ LEFT JOIN [EntityThree] AS [e0] ON [e].[EntityThreeId] = [e0].[Id]
AssertSql(
"""
SELECT [e].[Id], [e].[EntityThreeId], [e].[IntValue1], [e].[IntValue2], [e].[IntValue3], [e].[IntValue4], [e].[StringValue1], [e].[StringValue2], [e].[StringValue3], [e].[StringValue4], [e].[OwnedReference_Id], [e].[OwnedReference_OwnedIntValue1], [e].[OwnedReference_OwnedIntValue2], [o0].[OwnedIntValue3], [o].[OwnedIntValue4], [e].[OwnedReference_OwnedStringValue1], [e].[OwnedReference_OwnedStringValue2], [o0].[OwnedStringValue3], [o].[OwnedStringValue4]
FROM [EntityOne] AS [e]
LEFT JOIN [OwnedReferenceExtras2] AS [o] ON [e].[Id] = [o].[EntityOneId]
LEFT JOIN [OwnedReferenceExtras1] AS [o0] ON [e].[Id] = [o0].[EntityOneId]
SELECT `e`.`Id`, `e`.`EntityThreeId`, `e`.`IntValue1`, `e`.`IntValue2`, `e`.`IntValue3`, `e`.`IntValue4`, `e`.`StringValue1`, `e`.`StringValue2`, `e`.`StringValue3`, `e`.`StringValue4`, `e`.`OwnedReference_Id`, `e`.`OwnedReference_OwnedIntValue1`, `e`.`OwnedReference_OwnedIntValue2`, `o0`.`OwnedIntValue3`, `o`.`OwnedIntValue4`, `e`.`OwnedReference_OwnedStringValue1`, `e`.`OwnedReference_OwnedStringValue2`, `o0`.`OwnedStringValue3`, `o`.`OwnedStringValue4`
FROM (`EntityOne` AS `e`
LEFT JOIN `OwnedReferenceExtras2` AS `o` ON `e`.`Id` = `o`.`EntityOneId`)
LEFT JOIN `OwnedReferenceExtras1` AS `o0` ON `e`.`Id` = `o0`.`EntityOneId`
""");
}
@ -214,14 +214,10 @@ LEFT JOIN [OwnedReferenceExtras1] AS [o0] ON [e].[Id] = [o0].[EntityOneId]
AssertSql(
"""
SELECT [e].[Id], CASE
WHEN ([e].[OwnedReference_Id] IS NOT NULL) AND ([e].[OwnedReference_OwnedIntValue1] IS NOT NULL) AND ([e].[OwnedReference_OwnedIntValue2] IS NOT NULL) AND ([o0].[OwnedIntValue3] IS NOT NULL) AND ([o].[OwnedIntValue4] IS NOT NULL) THEN [o].[OwnedIntValue4]
END AS [OwnedIntValue4], CASE
WHEN ([e].[OwnedReference_Id] IS NOT NULL) AND ([e].[OwnedReference_OwnedIntValue1] IS NOT NULL) AND ([e].[OwnedReference_OwnedIntValue2] IS NOT NULL) AND ([o0].[OwnedIntValue3] IS NOT NULL) AND ([o].[OwnedIntValue4] IS NOT NULL) THEN [o].[OwnedStringValue4]
END AS [OwnedStringValue4]
FROM [EntityOnes] AS [e]
LEFT JOIN [OwnedReferenceExtras2] AS [o] ON [e].[Id] = [o].[EntityOneId]
LEFT JOIN [OwnedReferenceExtras1] AS [o0] ON [e].[Id] = [o0].[EntityOneId]
SELECT `e`.`Id`, IIF((`e`.`OwnedReference_Id` IS NOT NULL) AND (`e`.`OwnedReference_OwnedIntValue1` IS NOT NULL) AND (`e`.`OwnedReference_OwnedIntValue2` IS NOT NULL) AND (`o0`.`OwnedIntValue3` IS NOT NULL) AND (`o`.`OwnedIntValue4` IS NOT NULL), `o`.`OwnedIntValue4`, NULL) AS `OwnedIntValue4`, IIF((`e`.`OwnedReference_Id` IS NOT NULL) AND (`e`.`OwnedReference_OwnedIntValue1` IS NOT NULL) AND (`e`.`OwnedReference_OwnedIntValue2` IS NOT NULL) AND (`o0`.`OwnedIntValue3` IS NOT NULL) AND (`o`.`OwnedIntValue4` IS NOT NULL), `o`.`OwnedStringValue4`, NULL) AS `OwnedStringValue4`
FROM (`EntityOnes` AS `e`
LEFT JOIN `OwnedReferenceExtras2` AS `o` ON `e`.`Id` = `o`.`EntityOneId`)
LEFT JOIN `OwnedReferenceExtras1` AS `o0` ON `e`.`Id` = `o0`.`EntityOneId`
""");
}
@ -255,12 +251,12 @@ LEFT JOIN [OwnedReferenceExtras1] AS [o0] ON [e].[Id] = [o0].[EntityOneId]
AssertSql(
"""
SELECT [e].[Id], [e].[EntityThreeId], [e].[IntValue1], [e].[IntValue2], [e].[IntValue3], [e].[IntValue4], [e].[StringValue1], [e].[StringValue2], [e].[StringValue3], [e].[StringValue4], [e].[OwnedReference_Id], [e].[OwnedReference_OwnedIntValue1], [e].[OwnedReference_OwnedIntValue2], [o0].[OwnedIntValue3], [o].[OwnedIntValue4], [e].[OwnedReference_OwnedStringValue1], [e].[OwnedReference_OwnedStringValue2], [o0].[OwnedStringValue3], [o].[OwnedStringValue4], [e].[OwnedReference_OwnedNestedReference_Id], [e].[OwnedReference_OwnedNestedReference_OwnedNestedIntValue1], [e].[OwnedReference_OwnedNestedReference_OwnedNestedIntValue2], [o2].[OwnedNestedIntValue3], [o1].[OwnedNestedIntValue4], [e].[OwnedReference_OwnedNestedReference_OwnedNestedStringValue1], [e].[OwnedReference_OwnedNestedReference_OwnedNestedStringValue2], [o2].[OwnedNestedStringValue3], [o1].[OwnedNestedStringValue4]
FROM [EntityOnes] AS [e]
LEFT JOIN [OwnedReferenceExtras2] AS [o] ON [e].[Id] = [o].[EntityOneId]
LEFT JOIN [OwnedReferenceExtras1] AS [o0] ON [e].[Id] = [o0].[EntityOneId]
LEFT JOIN [OwnedNestedReferenceExtras2] AS [o1] ON [e].[Id] = [o1].[OwnedReferenceEntityOneId]
LEFT JOIN [OwnedNestedReferenceExtras1] AS [o2] ON [e].[Id] = [o2].[OwnedReferenceEntityOneId]
SELECT `e`.`Id`, `e`.`EntityThreeId`, `e`.`IntValue1`, `e`.`IntValue2`, `e`.`IntValue3`, `e`.`IntValue4`, `e`.`StringValue1`, `e`.`StringValue2`, `e`.`StringValue3`, `e`.`StringValue4`, `e`.`OwnedReference_Id`, `e`.`OwnedReference_OwnedIntValue1`, `e`.`OwnedReference_OwnedIntValue2`, `o0`.`OwnedIntValue3`, `o`.`OwnedIntValue4`, `e`.`OwnedReference_OwnedStringValue1`, `e`.`OwnedReference_OwnedStringValue2`, `o0`.`OwnedStringValue3`, `o`.`OwnedStringValue4`, `e`.`OwnedReference_OwnedNestedReference_Id`, `e`.`OwnedReference_OwnedNestedReference_OwnedNestedIntValue1`, `e`.`OwnedReference_OwnedNestedReference_OwnedNestedIntValue2`, `o2`.`OwnedNestedIntValue3`, `o1`.`OwnedNestedIntValue4`, `e`.`OwnedReference_OwnedNestedReference_OwnedNestedStringValue1`, `e`.`OwnedReference_OwnedNestedReference_OwnedNestedStringValue2`, `o2`.`OwnedNestedStringValue3`, `o1`.`OwnedNestedStringValue4`
FROM (((`EntityOnes` AS `e`
LEFT JOIN `OwnedReferenceExtras2` AS `o` ON `e`.`Id` = `o`.`EntityOneId`)
LEFT JOIN `OwnedReferenceExtras1` AS `o0` ON `e`.`Id` = `o0`.`EntityOneId`)
LEFT JOIN `OwnedNestedReferenceExtras2` AS `o1` ON `e`.`Id` = `o1`.`OwnedReferenceEntityOneId`)
LEFT JOIN `OwnedNestedReferenceExtras1` AS `o2` ON `e`.`Id` = `o2`.`OwnedReferenceEntityOneId`
""");
}
@ -270,10 +266,10 @@ LEFT JOIN [OwnedNestedReferenceExtras1] AS [o2] ON [e].[Id] = [o2].[OwnedReferen
AssertSql(
"""
SELECT [e].[Id], [e].[EntityThreeId], [e].[IntValue1], [e].[IntValue2], [s0].[IntValue3], [s].[IntValue4], [e].[StringValue1], [e].[StringValue2], [s0].[StringValue3], [s].[StringValue4], [e].[OwnedReference_Id], [e].[OwnedReference_OwnedIntValue1], [e].[OwnedReference_OwnedIntValue2], [e].[OwnedReference_OwnedIntValue3], [e].[OwnedReference_OwnedIntValue4], [e].[OwnedReference_OwnedStringValue1], [e].[OwnedReference_OwnedStringValue2], [e].[OwnedReference_OwnedStringValue3], [e].[OwnedReference_OwnedStringValue4]
FROM [EntityOne] AS [e]
INNER JOIN [SplitEntityOnePart3] AS [s] ON [e].[Id] = [s].[Id]
INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e].[Id] = [s0].[Id]
SELECT `e`.`Id`, `e`.`EntityThreeId`, `e`.`IntValue1`, `e`.`IntValue2`, `s0`.`IntValue3`, `s`.`IntValue4`, `e`.`StringValue1`, `e`.`StringValue2`, `s0`.`StringValue3`, `s`.`StringValue4`, `e`.`OwnedReference_Id`, `e`.`OwnedReference_OwnedIntValue1`, `e`.`OwnedReference_OwnedIntValue2`, `e`.`OwnedReference_OwnedIntValue3`, `e`.`OwnedReference_OwnedIntValue4`, `e`.`OwnedReference_OwnedStringValue1`, `e`.`OwnedReference_OwnedStringValue2`, `e`.`OwnedReference_OwnedStringValue3`, `e`.`OwnedReference_OwnedStringValue4`
FROM (`EntityOne` AS `e`
INNER JOIN `SplitEntityOnePart3` AS `s` ON `e`.`Id` = `s`.`Id`)
INNER JOIN `SplitEntityOnePart2` AS `s0` ON `e`.`Id` = `s0`.`Id`
""");
}
@ -283,12 +279,12 @@ INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e].[Id] = [s0].[Id]
AssertSql(
"""
SELECT [e].[Id], [e].[EntityThreeId], [e].[IntValue1], [e].[IntValue2], [s0].[IntValue3], [s].[IntValue4], [e].[StringValue1], [e].[StringValue2], [s0].[StringValue3], [s].[StringValue4], [o].[EntityOneId], [o].[Id], [o].[OwnedIntValue1], [o].[OwnedIntValue2], [o].[OwnedIntValue3], [o].[OwnedIntValue4], [o].[OwnedStringValue1], [o].[OwnedStringValue2], [o].[OwnedStringValue3], [o].[OwnedStringValue4]
FROM [EntityOne] AS [e]
INNER JOIN [SplitEntityOnePart3] AS [s] ON [e].[Id] = [s].[Id]
INNER JOIN [SplitEntityOnePart2] AS [s0] ON [e].[Id] = [s0].[Id]
LEFT JOIN [OwnedCollection] AS [o] ON [e].[Id] = [o].[EntityOneId]
ORDER BY [e].[Id], [o].[EntityOneId]
SELECT `e`.`Id`, `e`.`EntityThreeId`, `e`.`IntValue1`, `e`.`IntValue2`, `s0`.`IntValue3`, `s`.`IntValue4`, `e`.`StringValue1`, `e`.`StringValue2`, `s0`.`StringValue3`, `s`.`StringValue4`, `o`.`EntityOneId`, `o`.`Id`, `o`.`OwnedIntValue1`, `o`.`OwnedIntValue2`, `o`.`OwnedIntValue3`, `o`.`OwnedIntValue4`, `o`.`OwnedStringValue1`, `o`.`OwnedStringValue2`, `o`.`OwnedStringValue3`, `o`.`OwnedStringValue4`
FROM ((`EntityOne` AS `e`
INNER JOIN `SplitEntityOnePart3` AS `s` ON `e`.`Id` = `s`.`Id`)
INNER JOIN `SplitEntityOnePart2` AS `s0` ON `e`.`Id` = `s0`.`Id`)
LEFT JOIN `OwnedCollection` AS `o` ON `e`.`Id` = `o`.`EntityOneId`
ORDER BY `e`.`Id`, `o`.`EntityOneId`
""");
}
@ -314,10 +310,10 @@ ORDER BY [e].[Id], [o].[EntityOneId]
AssertSql(
"""
SELECT [s].[Id], [s].[EntityThreeId], [s].[IntValue1], [s].[IntValue2], [s1].[IntValue3], [s0].[IntValue4], [s].[StringValue1], [s].[StringValue2], [s1].[StringValue3], [s0].[StringValue4], [s].[OwnedReference_Id], [s].[OwnedReference_OwnedIntValue1], [s].[OwnedReference_OwnedIntValue2], [s1].[OwnedReference_OwnedIntValue3], [s0].[OwnedReference_OwnedIntValue4], [s].[OwnedReference_OwnedStringValue1], [s].[OwnedReference_OwnedStringValue2], [s1].[OwnedReference_OwnedStringValue3], [s0].[OwnedReference_OwnedStringValue4]
FROM [SplitEntityOnePart1] AS [s]
INNER JOIN [SplitEntityOnePart3] AS [s0] ON [s].[Id] = [s0].[Id]
INNER JOIN [SplitEntityOnePart2] AS [s1] ON [s].[Id] = [s1].[Id]
SELECT `s`.`Id`, `s`.`EntityThreeId`, `s`.`IntValue1`, `s`.`IntValue2`, `s1`.`IntValue3`, `s0`.`IntValue4`, `s`.`StringValue1`, `s`.`StringValue2`, `s1`.`StringValue3`, `s0`.`StringValue4`, `s`.`OwnedReference_Id`, `s`.`OwnedReference_OwnedIntValue1`, `s`.`OwnedReference_OwnedIntValue2`, `s1`.`OwnedReference_OwnedIntValue3`, `s0`.`OwnedReference_OwnedIntValue4`, `s`.`OwnedReference_OwnedStringValue1`, `s`.`OwnedReference_OwnedStringValue2`, `s1`.`OwnedReference_OwnedStringValue3`, `s0`.`OwnedReference_OwnedStringValue4`
FROM (`SplitEntityOnePart1` AS `s`
INNER JOIN `SplitEntityOnePart3` AS `s0` ON `s`.`Id` = `s0`.`Id`)
INNER JOIN `SplitEntityOnePart2` AS `s1` ON `s`.`Id` = `s1`.`Id`
""");
}
@ -327,11 +323,11 @@ INNER JOIN [SplitEntityOnePart2] AS [s1] ON [s].[Id] = [s1].[Id]
AssertSql(
"""
SELECT [s].[Id], [s].[EntityThreeId], [s].[IntValue1], [s].[IntValue2], [s1].[IntValue3], [s0].[IntValue4], [s].[StringValue1], [s].[StringValue2], [s1].[StringValue3], [s0].[StringValue4], [s].[OwnedReference_Id], [s].[OwnedReference_OwnedIntValue1], [s].[OwnedReference_OwnedIntValue2], [s1].[OwnedReference_OwnedIntValue3], [o].[OwnedIntValue4], [s].[OwnedReference_OwnedStringValue1], [s].[OwnedReference_OwnedStringValue2], [s1].[OwnedReference_OwnedStringValue3], [o].[OwnedStringValue4]
FROM [SplitEntityOnePart1] AS [s]
INNER JOIN [SplitEntityOnePart3] AS [s0] ON [s].[Id] = [s0].[Id]
INNER JOIN [SplitEntityOnePart2] AS [s1] ON [s].[Id] = [s1].[Id]
LEFT JOIN [OwnedReferencePart3] AS [o] ON [s].[Id] = [o].[EntityOneId]
SELECT `s`.`Id`, `s`.`EntityThreeId`, `s`.`IntValue1`, `s`.`IntValue2`, `s1`.`IntValue3`, `s0`.`IntValue4`, `s`.`StringValue1`, `s`.`StringValue2`, `s1`.`StringValue3`, `s0`.`StringValue4`, `s`.`OwnedReference_Id`, `s`.`OwnedReference_OwnedIntValue1`, `s`.`OwnedReference_OwnedIntValue2`, `s1`.`OwnedReference_OwnedIntValue3`, `o`.`OwnedIntValue4`, `s`.`OwnedReference_OwnedStringValue1`, `s`.`OwnedReference_OwnedStringValue2`, `s1`.`OwnedReference_OwnedStringValue3`, `o`.`OwnedStringValue4`
FROM ((`SplitEntityOnePart1` AS `s`
INNER JOIN `SplitEntityOnePart3` AS `s0` ON `s`.`Id` = `s0`.`Id`)
INNER JOIN `SplitEntityOnePart2` AS `s1` ON `s`.`Id` = `s1`.`Id`)
LEFT JOIN `OwnedReferencePart3` AS `o` ON `s`.`Id` = `o`.`EntityOneId`
""");
}
@ -341,12 +337,12 @@ LEFT JOIN [OwnedReferencePart3] AS [o] ON [s].[Id] = [o].[EntityOneId]
AssertSql(
"""
SELECT [s].[Id], [s].[EntityThreeId], [s].[IntValue1], [s].[IntValue2], [s1].[IntValue3], [s0].[IntValue4], [s].[StringValue1], [s].[StringValue2], [s1].[StringValue3], [s0].[StringValue4], [s1].[Id], [s1].[OwnedReference_Id], [s1].[OwnedReference_OwnedIntValue1], [s1].[OwnedReference_OwnedIntValue2], [o0].[OwnedIntValue3], [o].[OwnedIntValue4], [s1].[OwnedReference_OwnedStringValue1], [s1].[OwnedReference_OwnedStringValue2], [o0].[OwnedStringValue3], [o].[OwnedStringValue4]
FROM [SplitEntityOnePart1] AS [s]
INNER JOIN [SplitEntityOnePart3] AS [s0] ON [s].[Id] = [s0].[Id]
INNER JOIN [SplitEntityOnePart2] AS [s1] ON [s].[Id] = [s1].[Id]
LEFT JOIN [OwnedReferencePart3] AS [o] ON [s1].[Id] = [o].[EntityOneId]
LEFT JOIN [OwnedReferencePart2] AS [o0] ON [s1].[Id] = [o0].[EntityOneId]
SELECT `s`.`Id`, `s`.`EntityThreeId`, `s`.`IntValue1`, `s`.`IntValue2`, `s1`.`IntValue3`, `s0`.`IntValue4`, `s`.`StringValue1`, `s`.`StringValue2`, `s1`.`StringValue3`, `s0`.`StringValue4`, `s1`.`Id`, `s1`.`OwnedReference_Id`, `s1`.`OwnedReference_OwnedIntValue1`, `s1`.`OwnedReference_OwnedIntValue2`, `o0`.`OwnedIntValue3`, `o`.`OwnedIntValue4`, `s1`.`OwnedReference_OwnedStringValue1`, `s1`.`OwnedReference_OwnedStringValue2`, `o0`.`OwnedStringValue3`, `o`.`OwnedStringValue4`
FROM (((`SplitEntityOnePart1` AS `s`
INNER JOIN `SplitEntityOnePart3` AS `s0` ON `s`.`Id` = `s0`.`Id`)
INNER JOIN `SplitEntityOnePart2` AS `s1` ON `s`.`Id` = `s1`.`Id`)
LEFT JOIN `OwnedReferencePart3` AS `o` ON `s1`.`Id` = `o`.`EntityOneId`)
LEFT JOIN `OwnedReferencePart2` AS `o0` ON `s1`.`Id` = `o0`.`EntityOneId`
""");
}
@ -356,10 +352,10 @@ LEFT JOIN [OwnedReferencePart2] AS [o0] ON [s1].[Id] = [o0].[EntityOneId]
AssertSql(
"""
SELECT [b].[Id], [b].[BaseValue], [b].[Discriminator], [b].[MiddleValue], [b].[SiblingValue], [b].[LeafValue], [b].[OwnedReference_Id], [b].[OwnedReference_OwnedIntValue1], [b].[OwnedReference_OwnedIntValue2], [o0].[OwnedIntValue3], [o].[OwnedIntValue4], [b].[OwnedReference_OwnedStringValue1], [b].[OwnedReference_OwnedStringValue2], [o0].[OwnedStringValue3], [o].[OwnedStringValue4]
FROM [BaseEntity] AS [b]
LEFT JOIN [OwnedReferencePart4] AS [o] ON [b].[Id] = [o].[BaseEntityId]
LEFT JOIN [OwnedReferencePart3] AS [o0] ON [b].[Id] = [o0].[BaseEntityId]
SELECT `b`.`Id`, `b`.`BaseValue`, `b`.`Discriminator`, `b`.`MiddleValue`, `b`.`SiblingValue`, `b`.`LeafValue`, `b`.`OwnedReference_Id`, `b`.`OwnedReference_OwnedIntValue1`, `b`.`OwnedReference_OwnedIntValue2`, `o0`.`OwnedIntValue3`, `o`.`OwnedIntValue4`, `b`.`OwnedReference_OwnedStringValue1`, `b`.`OwnedReference_OwnedStringValue2`, `o0`.`OwnedStringValue3`, `o`.`OwnedStringValue4`
FROM (`BaseEntity` AS `b`
LEFT JOIN `OwnedReferencePart4` AS `o` ON `b`.`Id` = `o`.`BaseEntityId`)
LEFT JOIN `OwnedReferencePart3` AS `o0` ON `b`.`Id` = `o0`.`BaseEntityId`
""");
}
@ -369,17 +365,13 @@ LEFT JOIN [OwnedReferencePart3] AS [o0] ON [b].[Id] = [o0].[BaseEntityId]
AssertSql(
"""
SELECT [b].[Id], [b].[BaseValue], [m].[MiddleValue], [s].[SiblingValue], [l].[LeafValue], CASE
WHEN [l].[Id] IS NOT NULL THEN N'LeafEntity'
WHEN [s].[Id] IS NOT NULL THEN N'SiblingEntity'
WHEN [m].[Id] IS NOT NULL THEN N'MiddleEntity'
END AS [Discriminator], [b].[OwnedReference_Id], [b].[OwnedReference_OwnedIntValue1], [b].[OwnedReference_OwnedIntValue2], [o0].[OwnedIntValue3], [o].[OwnedIntValue4], [b].[OwnedReference_OwnedStringValue1], [b].[OwnedReference_OwnedStringValue2], [o0].[OwnedStringValue3], [o].[OwnedStringValue4]
FROM [BaseEntity] AS [b]
LEFT JOIN [MiddleEntity] AS [m] ON [b].[Id] = [m].[Id]
LEFT JOIN [SiblingEntity] AS [s] ON [b].[Id] = [s].[Id]
LEFT JOIN [LeafEntity] AS [l] ON [b].[Id] = [l].[Id]
LEFT JOIN [OwnedReferencePart4] AS [o] ON [b].[Id] = [o].[BaseEntityId]
LEFT JOIN [OwnedReferencePart3] AS [o0] ON [b].[Id] = [o0].[BaseEntityId]
SELECT `b`.`Id`, `b`.`BaseValue`, `m`.`MiddleValue`, `s`.`SiblingValue`, `l`.`LeafValue`, IIF(`l`.`Id` IS NOT NULL, 'LeafEntity', IIF(`s`.`Id` IS NOT NULL, 'SiblingEntity', IIF(`m`.`Id` IS NOT NULL, 'MiddleEntity', NULL))) AS `Discriminator`, `b`.`OwnedReference_Id`, `b`.`OwnedReference_OwnedIntValue1`, `b`.`OwnedReference_OwnedIntValue2`, `o0`.`OwnedIntValue3`, `o`.`OwnedIntValue4`, `b`.`OwnedReference_OwnedStringValue1`, `b`.`OwnedReference_OwnedStringValue2`, `o0`.`OwnedStringValue3`, `o`.`OwnedStringValue4`
FROM ((((`BaseEntity` AS `b`
LEFT JOIN `MiddleEntity` AS `m` ON `b`.`Id` = `m`.`Id`)
LEFT JOIN `SiblingEntity` AS `s` ON `b`.`Id` = `s`.`Id`)
LEFT JOIN `LeafEntity` AS `l` ON `b`.`Id` = `l`.`Id`)
LEFT JOIN `OwnedReferencePart4` AS `o` ON `b`.`Id` = `o`.`BaseEntityId`)
LEFT JOIN `OwnedReferencePart3` AS `o0` ON `b`.`Id` = `o0`.`BaseEntityId`
""");
}
@ -389,10 +381,10 @@ LEFT JOIN [OwnedReferencePart3] AS [o0] ON [b].[Id] = [o0].[BaseEntityId]
AssertSql(
"""
SELECT [b].[Id], [b].[BaseValue], [b].[Discriminator], [b].[MiddleValue], [b].[SiblingValue], [b].[LeafValue], [b].[OwnedReference_Id], [b].[OwnedReference_OwnedIntValue1], [b].[OwnedReference_OwnedIntValue2], [o0].[OwnedIntValue3], [o].[OwnedIntValue4], [b].[OwnedReference_OwnedStringValue1], [b].[OwnedReference_OwnedStringValue2], [o0].[OwnedStringValue3], [o].[OwnedStringValue4]
FROM [BaseEntity] AS [b]
LEFT JOIN [OwnedReferencePart4] AS [o] ON [b].[Id] = [o].[MiddleEntityId]
LEFT JOIN [OwnedReferencePart3] AS [o0] ON [b].[Id] = [o0].[MiddleEntityId]
SELECT `b`.`Id`, `b`.`BaseValue`, `b`.`Discriminator`, `b`.`MiddleValue`, `b`.`SiblingValue`, `b`.`LeafValue`, `b`.`OwnedReference_Id`, `b`.`OwnedReference_OwnedIntValue1`, `b`.`OwnedReference_OwnedIntValue2`, `o0`.`OwnedIntValue3`, `o`.`OwnedIntValue4`, `b`.`OwnedReference_OwnedStringValue1`, `b`.`OwnedReference_OwnedStringValue2`, `o0`.`OwnedStringValue3`, `o`.`OwnedStringValue4`
FROM (`BaseEntity` AS `b`
LEFT JOIN `OwnedReferencePart4` AS `o` ON `b`.`Id` = `o`.`MiddleEntityId`)
LEFT JOIN `OwnedReferencePart3` AS `o0` ON `b`.`Id` = `o0`.`MiddleEntityId`
""");
}
@ -402,17 +394,13 @@ LEFT JOIN [OwnedReferencePart3] AS [o0] ON [b].[Id] = [o0].[MiddleEntityId]
AssertSql(
"""
SELECT [b].[Id], [b].[BaseValue], [m].[MiddleValue], [s].[SiblingValue], [l].[LeafValue], CASE
WHEN [l].[Id] IS NOT NULL THEN N'LeafEntity'
WHEN [s].[Id] IS NOT NULL THEN N'SiblingEntity'
WHEN [m].[Id] IS NOT NULL THEN N'MiddleEntity'
END AS [Discriminator], [m].[Id], [m].[OwnedReference_Id], [m].[OwnedReference_OwnedIntValue1], [m].[OwnedReference_OwnedIntValue2], [o0].[OwnedIntValue3], [o].[OwnedIntValue4], [m].[OwnedReference_OwnedStringValue1], [m].[OwnedReference_OwnedStringValue2], [o0].[OwnedStringValue3], [o].[OwnedStringValue4]
FROM [BaseEntity] AS [b]
LEFT JOIN [MiddleEntity] AS [m] ON [b].[Id] = [m].[Id]
LEFT JOIN [SiblingEntity] AS [s] ON [b].[Id] = [s].[Id]
LEFT JOIN [LeafEntity] AS [l] ON [b].[Id] = [l].[Id]
LEFT JOIN [OwnedReferencePart4] AS [o] ON [m].[Id] = [o].[MiddleEntityId]
LEFT JOIN [OwnedReferencePart3] AS [o0] ON [m].[Id] = [o0].[MiddleEntityId]
SELECT `b`.`Id`, `b`.`BaseValue`, `m`.`MiddleValue`, `s`.`SiblingValue`, `l`.`LeafValue`, IIF(`l`.`Id` IS NOT NULL, 'LeafEntity', IIF(`s`.`Id` IS NOT NULL, 'SiblingEntity', IIF(`m`.`Id` IS NOT NULL, 'MiddleEntity', NULL))) AS `Discriminator`, `m`.`Id`, `m`.`OwnedReference_Id`, `m`.`OwnedReference_OwnedIntValue1`, `m`.`OwnedReference_OwnedIntValue2`, `o0`.`OwnedIntValue3`, `o`.`OwnedIntValue4`, `m`.`OwnedReference_OwnedStringValue1`, `m`.`OwnedReference_OwnedStringValue2`, `o0`.`OwnedStringValue3`, `o`.`OwnedStringValue4`
FROM ((((`BaseEntity` AS `b`
LEFT JOIN `MiddleEntity` AS `m` ON `b`.`Id` = `m`.`Id`)
LEFT JOIN `SiblingEntity` AS `s` ON `b`.`Id` = `s`.`Id`)
LEFT JOIN `LeafEntity` AS `l` ON `b`.`Id` = `l`.`Id`)
LEFT JOIN `OwnedReferencePart4` AS `o` ON `m`.`Id` = `o`.`MiddleEntityId`)
LEFT JOIN `OwnedReferencePart3` AS `o0` ON `m`.`Id` = `o0`.`MiddleEntityId`
""");
}
@ -422,10 +410,10 @@ LEFT JOIN [OwnedReferencePart3] AS [o0] ON [m].[Id] = [o0].[MiddleEntityId]
AssertSql(
"""
SELECT [b].[Id], [b].[BaseValue], [b].[Discriminator], [b].[MiddleValue], [b].[SiblingValue], [b].[LeafValue], [b].[OwnedReference_Id], [b].[OwnedReference_OwnedIntValue1], [b].[OwnedReference_OwnedIntValue2], [o0].[OwnedIntValue3], [o].[OwnedIntValue4], [b].[OwnedReference_OwnedStringValue1], [b].[OwnedReference_OwnedStringValue2], [o0].[OwnedStringValue3], [o].[OwnedStringValue4]
FROM [BaseEntity] AS [b]
LEFT JOIN [OwnedReferencePart4] AS [o] ON [b].[Id] = [o].[LeafEntityId]
LEFT JOIN [OwnedReferencePart3] AS [o0] ON [b].[Id] = [o0].[LeafEntityId]
SELECT `b`.`Id`, `b`.`BaseValue`, `b`.`Discriminator`, `b`.`MiddleValue`, `b`.`SiblingValue`, `b`.`LeafValue`, `b`.`OwnedReference_Id`, `b`.`OwnedReference_OwnedIntValue1`, `b`.`OwnedReference_OwnedIntValue2`, `o0`.`OwnedIntValue3`, `o`.`OwnedIntValue4`, `b`.`OwnedReference_OwnedStringValue1`, `b`.`OwnedReference_OwnedStringValue2`, `o0`.`OwnedStringValue3`, `o`.`OwnedStringValue4`
FROM (`BaseEntity` AS `b`
LEFT JOIN `OwnedReferencePart4` AS `o` ON `b`.`Id` = `o`.`LeafEntityId`)
LEFT JOIN `OwnedReferencePart3` AS `o0` ON `b`.`Id` = `o0`.`LeafEntityId`
""");
}
@ -435,17 +423,13 @@ LEFT JOIN [OwnedReferencePart3] AS [o0] ON [b].[Id] = [o0].[LeafEntityId]
AssertSql(
"""
SELECT [b].[Id], [b].[BaseValue], [m].[MiddleValue], [s].[SiblingValue], [l].[LeafValue], CASE
WHEN [l].[Id] IS NOT NULL THEN N'LeafEntity'
WHEN [s].[Id] IS NOT NULL THEN N'SiblingEntity'
WHEN [m].[Id] IS NOT NULL THEN N'MiddleEntity'
END AS [Discriminator], [l].[Id], [l].[OwnedReference_Id], [l].[OwnedReference_OwnedIntValue1], [l].[OwnedReference_OwnedIntValue2], [o0].[OwnedIntValue3], [o].[OwnedIntValue4], [l].[OwnedReference_OwnedStringValue1], [l].[OwnedReference_OwnedStringValue2], [o0].[OwnedStringValue3], [o].[OwnedStringValue4]
FROM [BaseEntity] AS [b]
LEFT JOIN [MiddleEntity] AS [m] ON [b].[Id] = [m].[Id]
LEFT JOIN [SiblingEntity] AS [s] ON [b].[Id] = [s].[Id]
LEFT JOIN [LeafEntity] AS [l] ON [b].[Id] = [l].[Id]
LEFT JOIN [OwnedReferencePart4] AS [o] ON [l].[Id] = [o].[LeafEntityId]
LEFT JOIN [OwnedReferencePart3] AS [o0] ON [l].[Id] = [o0].[LeafEntityId]
SELECT `b`.`Id`, `b`.`BaseValue`, `m`.`MiddleValue`, `s`.`SiblingValue`, `l`.`LeafValue`, IIF(`l`.`Id` IS NOT NULL, 'LeafEntity', IIF(`s`.`Id` IS NOT NULL, 'SiblingEntity', IIF(`m`.`Id` IS NOT NULL, 'MiddleEntity', NULL))) AS `Discriminator`, `l`.`Id`, `l`.`OwnedReference_Id`, `l`.`OwnedReference_OwnedIntValue1`, `l`.`OwnedReference_OwnedIntValue2`, `o0`.`OwnedIntValue3`, `o`.`OwnedIntValue4`, `l`.`OwnedReference_OwnedStringValue1`, `l`.`OwnedReference_OwnedStringValue2`, `o0`.`OwnedStringValue3`, `o`.`OwnedStringValue4`
FROM ((((`BaseEntity` AS `b`
LEFT JOIN `MiddleEntity` AS `m` ON `b`.`Id` = `m`.`Id`)
LEFT JOIN `SiblingEntity` AS `s` ON `b`.`Id` = `s`.`Id`)
LEFT JOIN `LeafEntity` AS `l` ON `b`.`Id` = `l`.`Id`)
LEFT JOIN `OwnedReferencePart4` AS `o` ON `l`.`Id` = `o`.`LeafEntityId`)
LEFT JOIN `OwnedReferencePart3` AS `o0` ON `l`.`Id` = `o0`.`LeafEntityId`
""");
}
@ -481,11 +465,11 @@ LEFT JOIN [OwnedReferencePart3] AS [o0] ON [l].[Id] = [o0].[LeafEntityId]
AssertSql(
"""
SELECT [b].[Id], [b].[BaseValue], [b].[Discriminator], [b].[SiblingValue], [b].[OwnedReference_Id], [b].[OwnedReference_OwnedIntValue1], [b].[OwnedReference_OwnedIntValue2], [o0].[OwnedIntValue3], [o].[OwnedIntValue4], [b].[OwnedReference_OwnedStringValue1], [b].[OwnedReference_OwnedStringValue2], [o0].[OwnedStringValue3], [o].[OwnedStringValue4]
FROM [BaseEntity] AS [b]
LEFT JOIN [OwnedReferencePart4] AS [o] ON [b].[Id] = [o].[BaseEntityId]
LEFT JOIN [OwnedReferencePart3] AS [o0] ON [b].[Id] = [o0].[BaseEntityId]
WHERE [b].[Discriminator] = N'SiblingEntity'
SELECT `b`.`Id`, `b`.`BaseValue`, `b`.`Discriminator`, `b`.`SiblingValue`, `b`.`OwnedReference_Id`, `b`.`OwnedReference_OwnedIntValue1`, `b`.`OwnedReference_OwnedIntValue2`, `o0`.`OwnedIntValue3`, `o`.`OwnedIntValue4`, `b`.`OwnedReference_OwnedStringValue1`, `b`.`OwnedReference_OwnedStringValue2`, `o0`.`OwnedStringValue3`, `o`.`OwnedStringValue4`
FROM (`BaseEntity` AS `b`
LEFT JOIN `OwnedReferencePart4` AS `o` ON `b`.`Id` = `o`.`BaseEntityId`)
LEFT JOIN `OwnedReferencePart3` AS `o0` ON `b`.`Id` = `o0`.`BaseEntityId`
WHERE `b`.`Discriminator` = 'SiblingEntity'
""");
}
@ -495,11 +479,11 @@ WHERE [b].[Discriminator] = N'SiblingEntity'
AssertSql(
"""
SELECT [b].[Id], [b].[BaseValue], [s].[SiblingValue], [b].[OwnedReference_Id], [b].[OwnedReference_OwnedIntValue1], [b].[OwnedReference_OwnedIntValue2], [o0].[OwnedIntValue3], [o].[OwnedIntValue4], [b].[OwnedReference_OwnedStringValue1], [b].[OwnedReference_OwnedStringValue2], [o0].[OwnedStringValue3], [o].[OwnedStringValue4]
FROM [BaseEntity] AS [b]
INNER JOIN [SiblingEntity] AS [s] ON [b].[Id] = [s].[Id]
LEFT JOIN [OwnedReferencePart4] AS [o] ON [b].[Id] = [o].[BaseEntityId]
LEFT JOIN [OwnedReferencePart3] AS [o0] ON [b].[Id] = [o0].[BaseEntityId]
SELECT `b`.`Id`, `b`.`BaseValue`, `s`.`SiblingValue`, `b`.`OwnedReference_Id`, `b`.`OwnedReference_OwnedIntValue1`, `b`.`OwnedReference_OwnedIntValue2`, `o0`.`OwnedIntValue3`, `o`.`OwnedIntValue4`, `b`.`OwnedReference_OwnedStringValue1`, `b`.`OwnedReference_OwnedStringValue2`, `o0`.`OwnedStringValue3`, `o`.`OwnedStringValue4`
FROM ((`BaseEntity` AS `b`
INNER JOIN `SiblingEntity` AS `s` ON `b`.`Id` = `s`.`Id`)
LEFT JOIN `OwnedReferencePart4` AS `o` ON `b`.`Id` = `o`.`BaseEntityId`)
LEFT JOIN `OwnedReferencePart3` AS `o0` ON `b`.`Id` = `o0`.`BaseEntityId`
""");
}
@ -509,9 +493,9 @@ LEFT JOIN [OwnedReferencePart3] AS [o0] ON [b].[Id] = [o0].[BaseEntityId]
AssertSql(
"""
SELECT [b].[Id], [b].[BaseValue], [b].[Discriminator], [b].[SiblingValue]
FROM [BaseEntity] AS [b]
WHERE [b].[Discriminator] = N'SiblingEntity'
SELECT `b`.`Id`, `b`.`BaseValue`, `b`.`Discriminator`, `b`.`SiblingValue`
FROM `BaseEntity` AS `b`
WHERE `b`.`Discriminator` = 'SiblingEntity'
""");
}
@ -521,9 +505,9 @@ WHERE [b].[Discriminator] = N'SiblingEntity'
AssertSql(
"""
SELECT [b].[Id], [b].[BaseValue], [s].[SiblingValue]
FROM [BaseEntity] AS [b]
INNER JOIN [SiblingEntity] AS [s] ON [b].[Id] = [s].[Id]
SELECT `b`.`Id`, `b`.`BaseValue`, `s`.`SiblingValue`
FROM `BaseEntity` AS `b`
INNER JOIN `SiblingEntity` AS `s` ON `b`.`Id` = `s`.`Id`
""");
}
@ -533,9 +517,9 @@ INNER JOIN [SiblingEntity] AS [s] ON [b].[Id] = [s].[Id]
AssertSql(
"""
SELECT [b].[Id], [b].[BaseValue], [b].[Discriminator], [b].[SiblingValue]
FROM [BaseEntity] AS [b]
WHERE [b].[Discriminator] = N'SiblingEntity'
SELECT `b`.`Id`, `b`.`BaseValue`, `b`.`Discriminator`, `b`.`SiblingValue`
FROM `BaseEntity` AS `b`
WHERE `b`.`Discriminator` = 'SiblingEntity'
""");
}
@ -545,9 +529,9 @@ WHERE [b].[Discriminator] = N'SiblingEntity'
AssertSql(
"""
SELECT [b].[Id], [b].[BaseValue], [s].[SiblingValue]
FROM [BaseEntity] AS [b]
INNER JOIN [SiblingEntity] AS [s] ON [b].[Id] = [s].[Id]
SELECT `b`.`Id`, `b`.`BaseValue`, `s`.`SiblingValue`
FROM `BaseEntity` AS `b`
INNER JOIN `SiblingEntity` AS `s` ON `b`.`Id` = `s`.`Id`
""");
}
@ -557,8 +541,8 @@ INNER JOIN [SiblingEntity] AS [s] ON [b].[Id] = [s].[Id]
AssertSql(
"""
SELECT [s].[Id], [s].[BaseValue], [s].[SiblingValue]
FROM [SiblingEntity] AS [s]
SELECT `s`.`Id`, `s`.`BaseValue`, `s`.`SiblingValue`
FROM `SiblingEntity` AS `s`
""");
}

Loading…
Cancel
Save