From ff00f5aa0c4c14e0164c65e06242fc1e4af38fc3 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Tue, 20 Sep 2016 14:25:19 +0200 Subject: [PATCH] [#5545] Improve manual to explain Binding implementation in the context of static statements --- jOOQ-manual/src/main/resources/org/jooq/web/manual-3.5.xml | 3 +++ jOOQ-manual/src/main/resources/org/jooq/web/manual-3.6.xml | 6 ++++++ jOOQ-manual/src/main/resources/org/jooq/web/manual-3.7.xml | 6 ++++++ jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml | 6 ++++++ jOOQ-manual/src/main/resources/org/jooq/web/manual-3.9.xml | 6 ++++++ 5 files changed, 27 insertions(+) diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.5.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.5.xml index 52a50d91be..828945bbdb 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.5.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.5.xml @@ -13642,6 +13642,9 @@ public class PostgresJSONGsonBinding implements Binding { // Rending a bind variable for the binding context's value and casting it to the json type @Override public void sql(BindingSQLContext ctx) throws SQLException { + // Depending on how you generate your SQL, you may need to explicitly distinguish + // between jOOQ generating bind variables or inlined literals. If so, use this check: + // ctx.render().paramType() == INLINED ctx.render().visit(DSL.val(ctx.convert(converter()).value())).sql("::json"); } diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.6.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.6.xml index d4dd279f6d..9717985166 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.6.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.6.xml @@ -8957,6 +8957,9 @@ public class PostgresJSONGsonBinding implements Binding { // Rending a bind variable for the binding context's value and casting it to the json type @Override public void sql(BindingSQLContext ctx) throws SQLException { + // Depending on how you generate your SQL, you may need to explicitly distinguish + // between jOOQ generating bind variables or inlined literals. If so, use this check: + // ctx.render().paramType() == INLINED ctx.render().visit(DSL.val(ctx.convert(converter()).value())).sql("::json"); } @@ -14279,6 +14282,9 @@ public class PostgresJSONGsonBinding implements Binding { // Rending a bind variable for the binding context's value and casting it to the json type @Override public void sql(BindingSQLContext ctx) throws SQLException { + // Depending on how you generate your SQL, you may need to explicitly distinguish + // between jOOQ generating bind variables or inlined literals. If so, use this check: + // ctx.render().paramType() == INLINED ctx.render().visit(DSL.val(ctx.convert(converter()).value())).sql("::json"); } diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.7.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.7.xml index 9c4b96e475..4dc98d316e 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.7.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.7.xml @@ -9192,6 +9192,9 @@ public class PostgresJSONGsonBinding implements Binding { // Rending a bind variable for the binding context's value and casting it to the json type @Override public void sql(BindingSQLContext ctx) throws SQLException { + // Depending on how you generate your SQL, you may need to explicitly distinguish + // between jOOQ generating bind variables or inlined literals. If so, use this check: + // ctx.render().paramType() == INLINED ctx.render().visit(DSL.val(ctx.convert(converter()).value())).sql("::json"); } @@ -14651,6 +14654,9 @@ public class PostgresJSONGsonBinding implements Binding { // Rending a bind variable for the binding context's value and casting it to the json type @Override public void sql(BindingSQLContext ctx) throws SQLException { + // Depending on how you generate your SQL, you may need to explicitly distinguish + // between jOOQ generating bind variables or inlined literals. If so, use this check: + // ctx.render().paramType() == INLINED ctx.render().visit(DSL.val(ctx.convert(converter()).value())).sql("::json"); } diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml index 5811fcc25e..40b3bc6793 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml @@ -9281,6 +9281,9 @@ public class PostgresJSONGsonBinding implements Binding { // Rending a bind variable for the binding context's value and casting it to the json type @Override public void sql(BindingSQLContext ctx) throws SQLException { + // Depending on how you generate your SQL, you may need to explicitly distinguish + // between jOOQ generating bind variables or inlined literals. If so, use this check: + // ctx.render().paramType() == INLINED ctx.render().visit(DSL.val(ctx.convert(converter()).value())).sql("::json"); } @@ -14797,6 +14800,9 @@ public class PostgresJSONGsonBinding implements Binding { // Rending a bind variable for the binding context's value and casting it to the json type @Override public void sql(BindingSQLContext ctx) throws SQLException { + // Depending on how you generate your SQL, you may need to explicitly distinguish + // between jOOQ generating bind variables or inlined literals. If so, use this check: + // ctx.render().paramType() == INLINED ctx.render().visit(DSL.val(ctx.convert(converter()).value())).sql("::json"); } diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.9.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.9.xml index e26861e8b0..8f6d3f84da 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.9.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.9.xml @@ -9280,6 +9280,9 @@ public class PostgresJSONGsonBinding implements Binding { // Rending a bind variable for the binding context's value and casting it to the json type @Override public void sql(BindingSQLContext ctx) throws SQLException { + // Depending on how you generate your SQL, you may need to explicitly distinguish + // between jOOQ generating bind variables or inlined literals. If so, use this check: + // ctx.render().paramType() == INLINED ctx.render().visit(DSL.val(ctx.convert(converter()).value())).sql("::json"); } @@ -14796,6 +14799,9 @@ public class PostgresJSONGsonBinding implements Binding { // Rending a bind variable for the binding context's value and casting it to the json type @Override public void sql(BindingSQLContext ctx) throws SQLException { + // Depending on how you generate your SQL, you may need to explicitly distinguish + // between jOOQ generating bind variables or inlined literals. If so, use this check: + // ctx.render().paramType() == INLINED ctx.render().visit(DSL.val(ctx.convert(converter()).value())).sql("::json"); }