[jOOQ/jOOQ#19137] Override also InternalBinding::sqlBind0

This commit is contained in:
Lukas Eder 2025-10-08 11:02:53 +02:00
parent efb869e4a3
commit ca8e62f2e4
2 changed files with 34 additions and 1 deletions

View File

@ -676,8 +676,21 @@ implements
private final String getCastTypeName1(Configuration configuration) {
SQLDialect dialect = configuration.dialect();
if (isMultiset()) {
switch (Tools.emulateMultiset(configuration)) {
case JSON:
return SQLDataType.JSON.getCastTypeName(configuration);
case JSONB:
return SQLDataType.JSONB.getCastTypeName(configuration);
case XML:
return SQLDataType.XML.getCastTypeName(configuration);
default:
return castTypeName0();
}
}
// [#10277] Various qualified, user defined types
if (isEnum() || isUDT()) {
else if (isEnum() || isUDT()) {
return renderedTypeName0(configuration);
}

View File

@ -4874,6 +4874,26 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
}
}
@Override
final void sqlBind0(BindingSQLContext<U> ctx, Result<?> value) throws SQLException {
switch (emulateMultiset(ctx.configuration())) {
case JSON:
jsonBinding.sqlBind0((BindingSQLContext) ctx, json(value.formatJSON(jsonFormat(ctx))));
break;
case JSONB:
jsonbBinding.sqlBind0((BindingSQLContext) ctx, jsonb(value.formatJSON(jsonFormat(ctx))));
break;
case XML:
xmlBinding.sqlBind0((BindingSQLContext) ctx, xml(value.formatXML(XML_FORMAT)));
break;
default:
throw new UnsupportedOperationException("Cannot inline a value of type Result using " + emulateMultiset(ctx.configuration()) + " MULTISET emulation.");
}
}
@Override
final void set0(BindingSetStatementContext<U> ctx, Result<?> value) throws SQLException {
switch (emulateMultiset(ctx.configuration())) {