Skip to content

Add support for join with subselect #1003

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
nt-gt opened this issue Jul 7, 2021 · 1 comment
Closed

Add support for join with subselect #1003

nt-gt opened this issue Jul 7, 2021 · 1 comment
Assignees
Labels
in: selectbuilder SelectBuilder stands for the complete API for creating SQL statements programmatically. type: enhancement A general enhancement

Comments

@nt-gt
Copy link

nt-gt commented Jul 7, 2021

This is a split of #995 concerning the missing support for JOIN'ing with a subselect a la LEFT OUTER JOIN (SELECT ... ) AS alias ON alias.X = other_table.Y.

This is currently not possible with the SelectBuilder, which assumes that the joins will be tables.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 7, 2021
@schauder schauder added the type: enhancement A general enhancement label Jul 12, 2021
@schauder schauder self-assigned this Jul 12, 2021
@schauder schauder added in: selectbuilder SelectBuilder stands for the complete API for creating SQL statements programmatically. and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 19, 2021
schauder added a commit that referenced this issue Jul 29, 2021
`InlineQuery` can be used whereever a `Table` was used up to now.

```
Table one = ...;
Select select = Select.builder()
		.select(one.column("id"), employee.column("name"))
		.from(one)
		.build();

InlineQuery inline = InlineQuery.create(select, "inline");
Select select = Select.builder()
		.select(inline.column("id"), inline.column("name"))
		.from(inline)
		.build();
```

Join and From renderer now use the same FromTableVisitor.
Also the SelectListVisitor reuses now the ExpressionVisitor.

Fixes #1003
schauder added a commit that referenced this issue Aug 27, 2021
See #1003
Original pull request #1018
mp911de added a commit that referenced this issue Sep 28, 2021
Reformat code. Remove duplicate, lingering Javadoc. Add override annotations. Use entities instead of < and >. Reduce method/class visibility in tests.

See #1003
Original pull request: #1018.
@mp911de mp911de changed the title Missing support for join with subselect Add support for join with subselect Sep 28, 2021
@mp911de mp911de added this to the 2.3 RC1 (2021.1.0) milestone Sep 28, 2021
@nt-gt
Copy link
Author

nt-gt commented Sep 28, 2021

@schauder Thanks for implementing this. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: selectbuilder SelectBuilder stands for the complete API for creating SQL statements programmatically. type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants