Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HHH-11886 - Elaborate Envers documentation and switch to actual sourc…
…e code examples Migrate code snippets to test cases for Join relations queries with multiple predicates
- Loading branch information
1 parent
742d8be
commit ab98bcb
Showing
7 changed files
with
324 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...ide/chapters/envers/extras/envers-querying-entity-relation-join-multiple-restrictions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
select | ||
c.id as id1_5_, | ||
c.REV as REV2_5_, | ||
c.REVTYPE as REVTYPE3_5_, | ||
c.REVEND as REVEND4_5_, | ||
c.created_on as created_5_5_, | ||
c.firstName as firstNam6_5_, | ||
c.lastName as lastName7_5_, | ||
c.address_id as address_8_5_ | ||
from | ||
Customer_AUD c | ||
left outer join | ||
Address_AUD a | ||
on ( | ||
c.address_id=a.id | ||
or ( | ||
c.address_id is null | ||
) | ||
and ( | ||
a.id is null | ||
) | ||
) | ||
where | ||
c.REV<=? | ||
and c.REVTYPE<>? | ||
and ( | ||
c.REVEND>? | ||
or c.REVEND is null | ||
) | ||
and ( | ||
a.REV is null | ||
or a.REV<=? | ||
and ( | ||
a.REVEND>? | ||
or a.REVEND is null | ||
) | ||
) | ||
and ( | ||
a.city=? | ||
or a.country_id is null | ||
) | ||
|
||
-- binding parameter [1] as [INTEGER] - [1] | ||
-- binding parameter [2] as [INTEGER] - [2] | ||
-- binding parameter [3] as [INTEGER] - [1] | ||
-- binding parameter [4] as [INTEGER] - [1] | ||
-- binding parameter [5] as [INTEGER] - [1] | ||
-- binding parameter [6] as [VARCHAR] - [Cluj-Napoca] |
59 changes: 59 additions & 0 deletions
59
...ers/extras/envers-querying-entity-relation-nested-join-multiple-restrictions-combined.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
select | ||
cu.id as id1_5_, | ||
cu.REV as REV2_5_, | ||
cu.REVTYPE as REVTYPE3_5_, | ||
cu.REVEND as REVEND4_5_, | ||
cu.created_on as created_5_5_, | ||
cu.firstName as firstNam6_5_, | ||
cu.lastName as lastName7_5_, | ||
cu.address_id as address_8_5_ | ||
from | ||
Customer_AUD cu | ||
inner join | ||
Address_AUD a | ||
on ( | ||
cu.address_id=a.id | ||
or ( | ||
cu.address_id is null | ||
) | ||
and ( | ||
a.id is null | ||
) | ||
) | ||
inner join | ||
Country_AUD cr | ||
on ( | ||
a.country_id=cr.id | ||
or ( | ||
a.country_id is null | ||
) | ||
and ( | ||
cr.id is null | ||
) | ||
) | ||
where | ||
cu.REV<=? | ||
and cu.REVTYPE<>? | ||
and a.city=cr.name | ||
and ( | ||
cu.REVEND>? | ||
or cu.REVEND is null | ||
) | ||
and a.REV<=? | ||
and ( | ||
a.REVEND>? | ||
or a.REVEND is null | ||
) | ||
and cr.REV<=? | ||
and ( | ||
cr.REVEND>? | ||
or cr.REVEND is null | ||
) | ||
|
||
-- binding parameter [1] as [INTEGER] - [2] | ||
-- binding parameter [2] as [INTEGER] - [2] | ||
-- binding parameter [3] as [INTEGER] - [2] | ||
-- binding parameter [4] as [INTEGER] - [2] | ||
-- binding parameter [5] as [INTEGER] - [2] | ||
-- binding parameter [6] as [INTEGER] - [2] | ||
-- binding parameter [7] as [INTEGER] - [2] |
66 changes: 66 additions & 0 deletions
66
...pters/envers/extras/envers-querying-entity-relation-nested-join-multiple-restrictions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
select | ||
cu.id as id1_5_, | ||
cu.REV as REV2_5_, | ||
cu.REVTYPE as REVTYPE3_5_, | ||
cu.REVEND as REVEND4_5_, | ||
cu.created_on as created_5_5_, | ||
cu.firstName as firstNam6_5_, | ||
cu.lastName as lastName7_5_, | ||
cu.address_id as address_8_5_ | ||
from | ||
Customer_AUD cu | ||
inner join | ||
Address_AUD a | ||
on ( | ||
cu.address_id=a.id | ||
or ( | ||
cu.address_id is null | ||
) | ||
and ( | ||
a.id is null | ||
) | ||
) | ||
inner join | ||
Country_AUD co | ||
on ( | ||
a.country_id=co.id | ||
or ( | ||
a.country_id is null | ||
) | ||
and ( | ||
co.id is null | ||
) | ||
) | ||
where | ||
cu.REV<=? | ||
and cu.REVTYPE<>? | ||
and ( | ||
cu.REVEND>? | ||
or cu.REVEND is null | ||
) | ||
and ( | ||
a.city=? | ||
or co.name=? | ||
) | ||
and a.REV<=? | ||
and ( | ||
a.REVEND>? | ||
or a.REVEND is null | ||
) | ||
and co.REV<=? | ||
and ( | ||
co.REVEND>? | ||
or co.REVEND is null | ||
) | ||
order by | ||
cu.created_on asc | ||
|
||
-- binding parameter [1] as [INTEGER] - [1] | ||
-- binding parameter [2] as [INTEGER] - [2] | ||
-- binding parameter [3] as [INTEGER] - [1] | ||
-- binding parameter [4] as [VARCHAR] - [Cluj-Napoca] | ||
-- binding parameter [5] as [VARCHAR] - [România] | ||
-- binding parameter [6] as [INTEGER] - [1] | ||
-- binding parameter [7] as [INTEGER] - [1] | ||
-- binding parameter [8] as [INTEGER] - [1] | ||
-- binding parameter [9] as [INTEGER] - [1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.