From 89cc3203820331893c023d05a1eec95a42e6a8e8 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Thu, 19 Oct 2017 10:58:59 +0200 Subject: [PATCH] [#6722] Deprecate AbstractQueryPart.create() methods --- .../java/org/jooq/impl/AbstractQueryPart.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractQueryPart.java b/jOOQ/src/main/java/org/jooq/impl/AbstractQueryPart.java index 50385763d2..402d3db39b 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractQueryPart.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractQueryPart.java @@ -37,6 +37,7 @@ package org.jooq.impl; import java.sql.SQLException; +import org.jooq.Attachable; import org.jooq.BindContext; import org.jooq.Configuration; import org.jooq.Context; @@ -140,8 +141,10 @@ abstract class AbstractQueryPart implements QueryPartInternal { // This is a working default implementation. It should be overridden by // concrete subclasses, to improve performance if (that instanceof QueryPart) { - String sql1 = create().renderInlined(this); - String sql2 = create().renderInlined((QueryPart) that); + DSLContext dsl = configuration().dsl(); + + String sql1 = dsl.renderInlined(this); + String sql2 = dsl.renderInlined((QueryPart) that); return sql1.equals(sql2); } @@ -173,21 +176,33 @@ abstract class AbstractQueryPart implements QueryPartInternal { /** * Internal convenience method + * + * @deprecated - 3.11.0 - [#6722] - Use {@link Attachable#configuration()} + * and {@link Configuration#dsl()} instead. */ + @Deprecated protected final DSLContext create() { return create(configuration()); } /** * Internal convenience method + * + * @deprecated - 3.11.0 - [#6722] - Use {@link Attachable#configuration()} + * and {@link Configuration#dsl()} instead. */ + @Deprecated protected final DSLContext create(Configuration configuration) { return DSL.using(configuration); } /** * Internal convenience method + * + * @deprecated - 3.11.0 - [#6722] - Use {@link Attachable#configuration()} + * and {@link Configuration#dsl()} instead. */ + @Deprecated protected final DSLContext create(Context ctx) { return DSL.using(ctx.configuration()); }