[#7115] Allow usage of derived table as aliased parameter of TableImpl constructor
This commit is contained in:
parent
82a0c85bb9
commit
b617440628
@ -51,6 +51,7 @@ Authors and contributors of jOOQ or parts of jOOQ in alphabetical order:
|
||||
- Timur Shaidullin
|
||||
- Thomas Darimont
|
||||
- Tsukasa Kitachi
|
||||
- Victor Bronstein
|
||||
- Victor Z. Peng
|
||||
- Vladimir Kulev
|
||||
- Vladimir Vinogradov
|
||||
|
||||
@ -154,12 +154,15 @@ public class TableImpl<R extends Record> extends AbstractTable<R> {
|
||||
this.fields = new Fields<R>();
|
||||
|
||||
if (aliased != null) {
|
||||
|
||||
// [#7115] Allow for aliased expressions (e.g. derived tables) to be passed to TableImpl
|
||||
// in order to support "type safe views"
|
||||
Alias<Table<R>> existingAlias = Tools.alias(aliased);
|
||||
if (existingAlias != null) {
|
||||
alias = existingAlias;
|
||||
} else {
|
||||
|
||||
if (existingAlias != null)
|
||||
alias = new Alias<Table<R>>(existingAlias.wrapped, name, existingAlias.fieldAliases, existingAlias.wrapInParentheses);
|
||||
else
|
||||
alias = new Alias<Table<R>>(aliased, name);
|
||||
}
|
||||
}
|
||||
else
|
||||
alias = null;
|
||||
|
||||
@ -51,6 +51,7 @@ Authors and contributors of jOOQ or parts of jOOQ in alphabetical order:
|
||||
- Timur Shaidullin
|
||||
- Thomas Darimont
|
||||
- Tsukasa Kitachi
|
||||
- Victor Bronstein
|
||||
- Victor Z. Peng
|
||||
- Vladimir Kulev
|
||||
- Vladimir Vinogradov
|
||||
|
||||
Loading…
Reference in New Issue
Block a user