Skip to content

Sorting on nested optional relations produces inner joins instead of outer joins [DATAJPA-1822] #2111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Nov 19, 2020 · 0 comments
Assignees
Labels
in: core Issues in core support type: bug A general bug

Comments

@spring-projects-issues
Copy link

Patrice Blanchardie opened DATAJPA-1822 and commented

See DATAJPA-1762:

When sorting on nested manyToOne, if the first-level is optional=true and the nested ones are optional=false (and vice versa), we expect a left join on nested levels, but cross joins with where clauses are generated (behaving like inner join, so absent lines are not included in result).

The problem comes from the way that QueryUtils.toExpressionRecursively and QueryUtils.requiresOuterJoin try to guess if a left join is required. When an outer join occurs, nested levels should not become inner joins.

Reproducible example attached


Affects: 2.3.5 (Neumann SR5), 2.4.1 (2020.0.1)

Attachments:

Referenced from: pull request #436

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants