[jOOQ/jOOQ#13288] Emluate SQL/XML XMLCONCAT in T-SQL

This commit is contained in:
Lukas Eder 2022-03-16 12:13:16 +01:00
parent 01a36170a4
commit f316d6daf0
2 changed files with 25 additions and 2 deletions

View File

@ -1555,6 +1555,19 @@ final class Tools {
return castFields;
}
/**
* [#461] [#473] [#2597] [#8234] Some internals need a cast only if necessary.
*/
@SuppressWarnings("unchecked")
static final <T> Field<T>[] castAllIfNeeded(Field<?>[] fields, DataType<T> type) {
Field<T>[] castFields = new Field[fields.length];
for (int i = 0; i < fields.length; i++)
castFields[i] = castIfNeeded(fields[i], type);
return castFields;
}
/**
* [#461] [#473] [#2597] [#8234] Some internals need a cast only if necessary.
*/

View File

@ -93,6 +93,7 @@ implements
@Override
public final void accept(Context<?> ctx) {
switch (ctx.family()) {
@ -100,7 +101,16 @@ implements
ctx.visit(N_XMLCONCAT).sql('(').visit(QueryPartCollectionView.wrap(args)).sql(')');
default:
ctx.visit(N_XMLCONCAT).sql('(').visit(QueryPartCollectionView.wrap(args)).sql(')');
break;
}
}
@ -131,7 +141,7 @@ implements
}
public final Function1<? super Collection<? extends Field<?>>, ? extends QOM.XMLConcat> $constructor() {
return (a1) -> new XMLConcat((Collection<? extends Field<?>>) a1);
return (a1) -> new XMLConcat(a1);
}