Skip to content

Commit

Permalink
[#7405] Fixed regression
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaseder committed Jun 7, 2018
1 parent 940877c commit 14896c0
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions jOOQ/src/main/java/org/jooq/impl/UDTConstant.java
Expand Up @@ -69,8 +69,12 @@ public void accept(Context<?> ctx) {
bind0((BindContext) ctx);
}

final void toSQL0(RenderContext context) {
switch (context.family()) {
final void toSQL0(RenderContext ctx) {
ParamType paramType = ctx.paramType();
if (isInline())
ctx.paramType(INLINED);

switch (ctx.family()) {



Expand Down Expand Up @@ -108,21 +112,21 @@ final void toSQL0(RenderContext context) {
// Due to lack of UDT support in the Postgres JDBC drivers, all UDT's
// have to be inlined
case POSTGRES: {
toSQLInline(context);
return;
toSQLInline(ctx);
break;
}

// Assume default behaviour if dialect is not available
default:
toSQLInline(context);
return;
toSQLInline(ctx);
break;
}

if (isInline())
ctx.paramType(paramType);
}

private final void toSQLInline(RenderContext ctx) {
ParamType previous = ctx.paramType();
ctx.paramType(ParamType.INLINED);

switch (ctx.family()) {


Expand Down Expand Up @@ -152,13 +156,12 @@ private final void toSQLInline(RenderContext ctx) {
separator = ", ";
}

ctx.sql(')')
.paramType(previous);
ctx.sql(')');
}

@Deprecated
private final String getInlineConstructor(RenderContext context) {
switch (context.family()) {
private final String getInlineConstructor(RenderContext ctx) {
switch (ctx.family()) {



Expand All @@ -172,12 +175,12 @@ private final String getInlineConstructor(RenderContext context) {

// Assume default behaviour if dialect is not available
default:
return Tools.getMappedUDTName(context.configuration(), value);
return Tools.getMappedUDTName(ctx.configuration(), value);
}
}

final void bind0(BindContext context) {
switch (context.family()) {
final void bind0(BindContext ctx) {
switch (ctx.family()) {



Expand All @@ -195,13 +198,13 @@ final void bind0(BindContext context) {
// inlined instead: ROW(.., .., ..)
case POSTGRES: {
for (Field<?> field : value.fields())
context.visit(val(value.get(field)));
ctx.visit(val(value.get(field)));

break;
}

default:
throw new SQLDialectNotSupportedException("UDTs not supported in dialect " + context.dialect());
throw new SQLDialectNotSupportedException("UDTs not supported in dialect " + ctx.dialect());
}
}
}

0 comments on commit 14896c0

Please sign in to comment.