From 16593d3c58e46111677bf98f10afc91866894aee Mon Sep 17 00:00:00 2001 From: Jeff Butler Date: Fri, 25 Oct 2024 18:10:05 -0400 Subject: [PATCH 1/3] Refactor to remove renderer cycles --- .../dynamic/sql/delete/DeleteModel.java | 9 +- .../dynamic/sql/insert/BatchInsertModel.java | 8 +- .../sql/insert/GeneralInsertModel.java | 9 +- .../dynamic/sql/insert/InsertModel.java | 8 +- .../dynamic/sql/insert/InsertSelectModel.java | 9 +- .../sql/insert/MultiRowInsertModel.java | 8 +- .../dynamic/sql/render/Renderable.java | 21 +++ .../dynamic/sql/render/RendererFactory.java | 135 ++++++++++++++++++ .../dynamic/sql/select/MultiSelectModel.java | 10 +- .../dynamic/sql/select/SelectModel.java | 13 +- .../dynamic/sql/update/UpdateModel.java | 9 +- 11 files changed, 184 insertions(+), 55 deletions(-) create mode 100644 src/main/java/org/mybatis/dynamic/sql/render/Renderable.java create mode 100644 src/main/java/org/mybatis/dynamic/sql/render/RendererFactory.java diff --git a/src/main/java/org/mybatis/dynamic/sql/delete/DeleteModel.java b/src/main/java/org/mybatis/dynamic/sql/delete/DeleteModel.java index 54770d5d4..015f9823c 100644 --- a/src/main/java/org/mybatis/dynamic/sql/delete/DeleteModel.java +++ b/src/main/java/org/mybatis/dynamic/sql/delete/DeleteModel.java @@ -23,8 +23,8 @@ import org.mybatis.dynamic.sql.common.CommonBuilder; import org.mybatis.dynamic.sql.common.OrderByModel; import org.mybatis.dynamic.sql.configuration.StatementConfiguration; -import org.mybatis.dynamic.sql.delete.render.DeleteRenderer; import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.render.RendererFactory; import org.mybatis.dynamic.sql.render.RenderingStrategy; import org.mybatis.dynamic.sql.where.EmbeddedWhereModel; @@ -67,11 +67,8 @@ public Optional orderByModel() { @NotNull public DeleteStatementProvider render(RenderingStrategy renderingStrategy) { - return DeleteRenderer.withDeleteModel(this) - .withRenderingStrategy(renderingStrategy) - .withStatementConfiguration(statementConfiguration) - .build() - .render(); + return RendererFactory.createDeleteRenderer(this, statementConfiguration) + .render(renderingStrategy); } public static Builder withTable(SqlTable table) { diff --git a/src/main/java/org/mybatis/dynamic/sql/insert/BatchInsertModel.java b/src/main/java/org/mybatis/dynamic/sql/insert/BatchInsertModel.java index b591753a2..5e48e9035 100644 --- a/src/main/java/org/mybatis/dynamic/sql/insert/BatchInsertModel.java +++ b/src/main/java/org/mybatis/dynamic/sql/insert/BatchInsertModel.java @@ -19,7 +19,7 @@ import org.jetbrains.annotations.NotNull; import org.mybatis.dynamic.sql.insert.render.BatchInsert; -import org.mybatis.dynamic.sql.insert.render.BatchInsertRenderer; +import org.mybatis.dynamic.sql.render.RendererFactory; import org.mybatis.dynamic.sql.render.RenderingStrategy; import org.mybatis.dynamic.sql.util.Validator; @@ -33,10 +33,8 @@ private BatchInsertModel(Builder builder) { @NotNull public BatchInsert render(RenderingStrategy renderingStrategy) { - return BatchInsertRenderer.withBatchInsertModel(this) - .withRenderingStrategy(renderingStrategy) - .build() - .render(); + return RendererFactory.createBatchInsertRenderer(this) + .render(renderingStrategy); } public static Builder withRecords(Collection records) { diff --git a/src/main/java/org/mybatis/dynamic/sql/insert/GeneralInsertModel.java b/src/main/java/org/mybatis/dynamic/sql/insert/GeneralInsertModel.java index 7f219027d..f3fb146ee 100644 --- a/src/main/java/org/mybatis/dynamic/sql/insert/GeneralInsertModel.java +++ b/src/main/java/org/mybatis/dynamic/sql/insert/GeneralInsertModel.java @@ -23,8 +23,8 @@ import org.jetbrains.annotations.NotNull; import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.configuration.StatementConfiguration; -import org.mybatis.dynamic.sql.insert.render.GeneralInsertRenderer; import org.mybatis.dynamic.sql.insert.render.GeneralInsertStatementProvider; +import org.mybatis.dynamic.sql.render.RendererFactory; import org.mybatis.dynamic.sql.render.RenderingStrategy; import org.mybatis.dynamic.sql.util.AbstractColumnMapping; import org.mybatis.dynamic.sql.util.Validator; @@ -52,11 +52,8 @@ public SqlTable table() { @NotNull public GeneralInsertStatementProvider render(RenderingStrategy renderingStrategy) { - return GeneralInsertRenderer.withInsertModel(this) - .withRenderingStrategy(renderingStrategy) - .withStatementConfiguration(statementConfiguration) - .build() - .render(); + return RendererFactory.createGeneralInsertRenderer(this, statementConfiguration) + .render(renderingStrategy); } public static class Builder { diff --git a/src/main/java/org/mybatis/dynamic/sql/insert/InsertModel.java b/src/main/java/org/mybatis/dynamic/sql/insert/InsertModel.java index 7f740051e..07fac79ed 100644 --- a/src/main/java/org/mybatis/dynamic/sql/insert/InsertModel.java +++ b/src/main/java/org/mybatis/dynamic/sql/insert/InsertModel.java @@ -22,8 +22,8 @@ import org.jetbrains.annotations.NotNull; import org.mybatis.dynamic.sql.SqlTable; -import org.mybatis.dynamic.sql.insert.render.InsertRenderer; import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.render.RendererFactory; import org.mybatis.dynamic.sql.render.RenderingStrategy; import org.mybatis.dynamic.sql.util.AbstractColumnMapping; import org.mybatis.dynamic.sql.util.Validator; @@ -54,10 +54,8 @@ public SqlTable table() { @NotNull public InsertStatementProvider render(RenderingStrategy renderingStrategy) { - return InsertRenderer.withInsertModel(this) - .withRenderingStrategy(renderingStrategy) - .build() - .render(); + return RendererFactory.createInsertRenderer(this) + .render(renderingStrategy); } public static Builder withRow(T row) { diff --git a/src/main/java/org/mybatis/dynamic/sql/insert/InsertSelectModel.java b/src/main/java/org/mybatis/dynamic/sql/insert/InsertSelectModel.java index 4da2cef1c..5b22eaeb7 100644 --- a/src/main/java/org/mybatis/dynamic/sql/insert/InsertSelectModel.java +++ b/src/main/java/org/mybatis/dynamic/sql/insert/InsertSelectModel.java @@ -21,8 +21,8 @@ import org.jetbrains.annotations.NotNull; import org.mybatis.dynamic.sql.SqlTable; import org.mybatis.dynamic.sql.configuration.StatementConfiguration; -import org.mybatis.dynamic.sql.insert.render.InsertSelectRenderer; import org.mybatis.dynamic.sql.insert.render.InsertSelectStatementProvider; +import org.mybatis.dynamic.sql.render.RendererFactory; import org.mybatis.dynamic.sql.render.RenderingStrategy; import org.mybatis.dynamic.sql.select.SelectModel; @@ -53,11 +53,8 @@ public Optional columnList() { @NotNull public InsertSelectStatementProvider render(RenderingStrategy renderingStrategy) { - return InsertSelectRenderer.withInsertSelectModel(this) - .withRenderingStrategy(renderingStrategy) - .withStatementConfiguration(statementConfiguration) - .build() - .render(); + return RendererFactory.createInsertSelectRenderer(this, statementConfiguration) + .render(renderingStrategy); } public static Builder withTable(SqlTable table) { diff --git a/src/main/java/org/mybatis/dynamic/sql/insert/MultiRowInsertModel.java b/src/main/java/org/mybatis/dynamic/sql/insert/MultiRowInsertModel.java index 406c02b7a..d5d7f478d 100644 --- a/src/main/java/org/mybatis/dynamic/sql/insert/MultiRowInsertModel.java +++ b/src/main/java/org/mybatis/dynamic/sql/insert/MultiRowInsertModel.java @@ -18,8 +18,8 @@ import java.util.Collection; import org.jetbrains.annotations.NotNull; -import org.mybatis.dynamic.sql.insert.render.MultiRowInsertRenderer; import org.mybatis.dynamic.sql.insert.render.MultiRowInsertStatementProvider; +import org.mybatis.dynamic.sql.render.RendererFactory; import org.mybatis.dynamic.sql.render.RenderingStrategy; import org.mybatis.dynamic.sql.util.Validator; @@ -33,10 +33,8 @@ private MultiRowInsertModel(Builder builder) { @NotNull public MultiRowInsertStatementProvider render(RenderingStrategy renderingStrategy) { - return MultiRowInsertRenderer.withMultiRowInsertModel(this) - .withRenderingStrategy(renderingStrategy) - .build() - .render(); + return RendererFactory.createMultiRowInsertRenderer(this) + .render(renderingStrategy); } public static Builder withRecords(Collection records) { diff --git a/src/main/java/org/mybatis/dynamic/sql/render/Renderable.java b/src/main/java/org/mybatis/dynamic/sql/render/Renderable.java new file mode 100644 index 000000000..da999bfb8 --- /dev/null +++ b/src/main/java/org/mybatis/dynamic/sql/render/Renderable.java @@ -0,0 +1,21 @@ +/* + * Copyright 2016-2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mybatis.dynamic.sql.render; + +@FunctionalInterface +public interface Renderable { + R render(T t); +} diff --git a/src/main/java/org/mybatis/dynamic/sql/render/RendererFactory.java b/src/main/java/org/mybatis/dynamic/sql/render/RendererFactory.java new file mode 100644 index 000000000..2b8208272 --- /dev/null +++ b/src/main/java/org/mybatis/dynamic/sql/render/RendererFactory.java @@ -0,0 +1,135 @@ +/* + * Copyright 2016-2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mybatis.dynamic.sql.render; + +import org.mybatis.dynamic.sql.configuration.StatementConfiguration; +import org.mybatis.dynamic.sql.delete.DeleteModel; +import org.mybatis.dynamic.sql.delete.render.DeleteRenderer; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.BatchInsertModel; +import org.mybatis.dynamic.sql.insert.GeneralInsertModel; +import org.mybatis.dynamic.sql.insert.InsertModel; +import org.mybatis.dynamic.sql.insert.InsertSelectModel; +import org.mybatis.dynamic.sql.insert.MultiRowInsertModel; +import org.mybatis.dynamic.sql.insert.render.BatchInsert; +import org.mybatis.dynamic.sql.insert.render.BatchInsertRenderer; +import org.mybatis.dynamic.sql.insert.render.GeneralInsertRenderer; +import org.mybatis.dynamic.sql.insert.render.GeneralInsertStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertRenderer; +import org.mybatis.dynamic.sql.insert.render.InsertSelectRenderer; +import org.mybatis.dynamic.sql.insert.render.InsertSelectStatementProvider; +import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider; +import org.mybatis.dynamic.sql.insert.render.MultiRowInsertRenderer; +import org.mybatis.dynamic.sql.insert.render.MultiRowInsertStatementProvider; +import org.mybatis.dynamic.sql.select.MultiSelectModel; +import org.mybatis.dynamic.sql.select.SelectModel; +import org.mybatis.dynamic.sql.select.render.MultiSelectRenderer; +import org.mybatis.dynamic.sql.select.render.SelectRenderer; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.UpdateModel; +import org.mybatis.dynamic.sql.update.render.UpdateRenderer; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; + +public interface RendererFactory { + static Renderable createDeleteRenderer(DeleteModel deleteModel, + StatementConfiguration statementConfiguration) { + return renderingStrategy -> DeleteRenderer.withDeleteModel(deleteModel) + .withStatementConfiguration(statementConfiguration) + .withRenderingStrategy(renderingStrategy) + .build() + .render(); + } + + static Renderable> createBatchInsertRenderer( + BatchInsertModel batchInsertModel) { + return renderingStrategy -> BatchInsertRenderer.withBatchInsertModel(batchInsertModel) + .withRenderingStrategy(renderingStrategy) + .build() + .render(); + } + + static Renderable createGeneralInsertRenderer( + GeneralInsertModel generalInsertModel, StatementConfiguration statementConfiguration) { + return renderingStrategy -> GeneralInsertRenderer.withInsertModel(generalInsertModel) + .withStatementConfiguration(statementConfiguration) + .withRenderingStrategy(renderingStrategy) + .build() + .render(); + } + + static Renderable> createInsertRenderer( + InsertModel insertModel) { + return renderingStrategy -> InsertRenderer.withInsertModel(insertModel) + .withRenderingStrategy(renderingStrategy) + .build() + .render(); + } + + static Renderable createInsertSelectRenderer( + InsertSelectModel insertSelectModel, StatementConfiguration statementConfiguration) { + return renderingStrategy -> InsertSelectRenderer.withInsertSelectModel(insertSelectModel) + .withStatementConfiguration(statementConfiguration) + .withRenderingStrategy(renderingStrategy) + .build() + .render(); + } + + static Renderable> createMultiRowInsertRenderer( + MultiRowInsertModel multiRowInsertModel) { + return renderingStrategy -> MultiRowInsertRenderer.withMultiRowInsertModel(multiRowInsertModel) + .withRenderingStrategy(renderingStrategy) + .build() + .render(); + } + + static Renderable createMultiSelectRenderer( + MultiSelectModel multiSelectModel, StatementConfiguration statementConfiguration) { + return renderingStrategy -> new MultiSelectRenderer.Builder() + .withMultiSelectModel(multiSelectModel) + .withStatementConfiguration(statementConfiguration) + .withRenderingStrategy(renderingStrategy) + .build() + .render(); + } + + static Renderable createSelectRenderer( + SelectModel selectModel, StatementConfiguration statementConfiguration) { + return renderingStrategy -> { + RenderingContext renderingContext = RenderingContext.withRenderingStrategy(renderingStrategy) + .withStatementConfiguration(statementConfiguration) + .build(); + + return createSelectRenderer(selectModel).render(renderingContext); + }; + } + + static Renderable createSelectRenderer( + SelectModel selectModel) { + return renderingContext -> SelectRenderer.withSelectModel(selectModel) + .withRenderingContext(renderingContext) + .build() + .render(); + } + + static Renderable createUpdateRenderer( + UpdateModel updateModel, StatementConfiguration statementConfiguration) { + return renderingStrategy -> UpdateRenderer.withUpdateModel(updateModel) + .withStatementConfiguration(statementConfiguration) + .withRenderingStrategy(renderingStrategy) + .build() + .render(); + } +} diff --git a/src/main/java/org/mybatis/dynamic/sql/select/MultiSelectModel.java b/src/main/java/org/mybatis/dynamic/sql/select/MultiSelectModel.java index f9a1a388a..607378c20 100644 --- a/src/main/java/org/mybatis/dynamic/sql/select/MultiSelectModel.java +++ b/src/main/java/org/mybatis/dynamic/sql/select/MultiSelectModel.java @@ -21,8 +21,8 @@ import java.util.stream.Stream; import org.jetbrains.annotations.NotNull; +import org.mybatis.dynamic.sql.render.RendererFactory; import org.mybatis.dynamic.sql.render.RenderingStrategy; -import org.mybatis.dynamic.sql.select.render.MultiSelectRenderer; import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; import org.mybatis.dynamic.sql.util.Validator; @@ -47,12 +47,8 @@ public Stream unionQueries() { @NotNull public SelectStatementProvider render(RenderingStrategy renderingStrategy) { - return new MultiSelectRenderer.Builder() - .withMultiSelectModel(this) - .withRenderingStrategy(renderingStrategy) - .withStatementConfiguration(statementConfiguration) - .build() - .render(); + return RendererFactory.createMultiSelectRenderer(this, statementConfiguration) + .render(renderingStrategy); } public static class Builder extends AbstractBuilder { diff --git a/src/main/java/org/mybatis/dynamic/sql/select/SelectModel.java b/src/main/java/org/mybatis/dynamic/sql/select/SelectModel.java index 57fd06a43..32b745e0e 100644 --- a/src/main/java/org/mybatis/dynamic/sql/select/SelectModel.java +++ b/src/main/java/org/mybatis/dynamic/sql/select/SelectModel.java @@ -21,9 +21,9 @@ import java.util.stream.Stream; import org.jetbrains.annotations.NotNull; +import org.mybatis.dynamic.sql.render.RendererFactory; import org.mybatis.dynamic.sql.render.RenderingContext; import org.mybatis.dynamic.sql.render.RenderingStrategy; -import org.mybatis.dynamic.sql.select.render.SelectRenderer; import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; import org.mybatis.dynamic.sql.util.Validator; @@ -42,10 +42,8 @@ public Stream queryExpressions() { @NotNull public SelectStatementProvider render(RenderingStrategy renderingStrategy) { - RenderingContext renderingContext = RenderingContext.withRenderingStrategy(renderingStrategy) - .withStatementConfiguration(statementConfiguration) - .build(); - return render(renderingContext); + return RendererFactory.createSelectRenderer(this, statementConfiguration) + .render(renderingStrategy); } /** @@ -56,10 +54,7 @@ public SelectStatementProvider render(RenderingStrategy renderingStrategy) { */ @NotNull public SelectStatementProvider render(RenderingContext renderingContext) { - return SelectRenderer.withSelectModel(this) - .withRenderingContext(renderingContext) - .build() - .render(); + return RendererFactory.createSelectRenderer(this).render(renderingContext); } public static Builder withQueryExpressions(List queryExpressions) { diff --git a/src/main/java/org/mybatis/dynamic/sql/update/UpdateModel.java b/src/main/java/org/mybatis/dynamic/sql/update/UpdateModel.java index 7ff82df26..672b08c44 100644 --- a/src/main/java/org/mybatis/dynamic/sql/update/UpdateModel.java +++ b/src/main/java/org/mybatis/dynamic/sql/update/UpdateModel.java @@ -26,8 +26,8 @@ import org.mybatis.dynamic.sql.common.CommonBuilder; import org.mybatis.dynamic.sql.common.OrderByModel; import org.mybatis.dynamic.sql.configuration.StatementConfiguration; +import org.mybatis.dynamic.sql.render.RendererFactory; import org.mybatis.dynamic.sql.render.RenderingStrategy; -import org.mybatis.dynamic.sql.update.render.UpdateRenderer; import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; import org.mybatis.dynamic.sql.util.AbstractColumnMapping; import org.mybatis.dynamic.sql.util.Validator; @@ -79,11 +79,8 @@ public Optional orderByModel() { @NotNull public UpdateStatementProvider render(RenderingStrategy renderingStrategy) { - return UpdateRenderer.withUpdateModel(this) - .withRenderingStrategy(renderingStrategy) - .withStatementConfiguration(statementConfiguration) - .build() - .render(); + return RendererFactory.createUpdateRenderer(this, statementConfiguration) + .render(renderingStrategy); } public static Builder withTable(SqlTable table) { From df83f4331dec9579e7c29c5b39278bc82ecf7bcf Mon Sep 17 00:00:00 2001 From: Jeff Butler Date: Sun, 27 Oct 2024 14:32:12 -0400 Subject: [PATCH 2/3] Method reuse --- .../mybatis/dynamic/sql/render/RendererFactory.java | 11 ----------- .../org/mybatis/dynamic/sql/select/SelectModel.java | 6 ++++-- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/mybatis/dynamic/sql/render/RendererFactory.java b/src/main/java/org/mybatis/dynamic/sql/render/RendererFactory.java index 2b8208272..b925d8fde 100644 --- a/src/main/java/org/mybatis/dynamic/sql/render/RendererFactory.java +++ b/src/main/java/org/mybatis/dynamic/sql/render/RendererFactory.java @@ -105,17 +105,6 @@ static Renderable createMultiSelectR .render(); } - static Renderable createSelectRenderer( - SelectModel selectModel, StatementConfiguration statementConfiguration) { - return renderingStrategy -> { - RenderingContext renderingContext = RenderingContext.withRenderingStrategy(renderingStrategy) - .withStatementConfiguration(statementConfiguration) - .build(); - - return createSelectRenderer(selectModel).render(renderingContext); - }; - } - static Renderable createSelectRenderer( SelectModel selectModel) { return renderingContext -> SelectRenderer.withSelectModel(selectModel) diff --git a/src/main/java/org/mybatis/dynamic/sql/select/SelectModel.java b/src/main/java/org/mybatis/dynamic/sql/select/SelectModel.java index 32b745e0e..85196be7b 100644 --- a/src/main/java/org/mybatis/dynamic/sql/select/SelectModel.java +++ b/src/main/java/org/mybatis/dynamic/sql/select/SelectModel.java @@ -42,8 +42,10 @@ public Stream queryExpressions() { @NotNull public SelectStatementProvider render(RenderingStrategy renderingStrategy) { - return RendererFactory.createSelectRenderer(this, statementConfiguration) - .render(renderingStrategy); + RenderingContext renderingContext = RenderingContext.withRenderingStrategy(renderingStrategy) + .withStatementConfiguration(statementConfiguration) + .build(); + return render(renderingContext); } /** From 3ddf8bd601ac29dede66c4d2b521c79e54eb2b73 Mon Sep 17 00:00:00 2001 From: Jeff Butler Date: Mon, 28 Oct 2024 09:35:50 -0400 Subject: [PATCH 3/3] Better name --- .../render/{Renderable.java => Renderer.java} | 2 +- .../dynamic/sql/render/RendererFactory.java | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) rename src/main/java/org/mybatis/dynamic/sql/render/{Renderable.java => Renderer.java} (95%) diff --git a/src/main/java/org/mybatis/dynamic/sql/render/Renderable.java b/src/main/java/org/mybatis/dynamic/sql/render/Renderer.java similarity index 95% rename from src/main/java/org/mybatis/dynamic/sql/render/Renderable.java rename to src/main/java/org/mybatis/dynamic/sql/render/Renderer.java index da999bfb8..acb84a98f 100644 --- a/src/main/java/org/mybatis/dynamic/sql/render/Renderable.java +++ b/src/main/java/org/mybatis/dynamic/sql/render/Renderer.java @@ -16,6 +16,6 @@ package org.mybatis.dynamic.sql.render; @FunctionalInterface -public interface Renderable { +public interface Renderer { R render(T t); } diff --git a/src/main/java/org/mybatis/dynamic/sql/render/RendererFactory.java b/src/main/java/org/mybatis/dynamic/sql/render/RendererFactory.java index b925d8fde..c47ca1f78 100644 --- a/src/main/java/org/mybatis/dynamic/sql/render/RendererFactory.java +++ b/src/main/java/org/mybatis/dynamic/sql/render/RendererFactory.java @@ -44,8 +44,8 @@ import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; public interface RendererFactory { - static Renderable createDeleteRenderer(DeleteModel deleteModel, - StatementConfiguration statementConfiguration) { + static Renderer createDeleteRenderer(DeleteModel deleteModel, + StatementConfiguration statementConfiguration) { return renderingStrategy -> DeleteRenderer.withDeleteModel(deleteModel) .withStatementConfiguration(statementConfiguration) .withRenderingStrategy(renderingStrategy) @@ -53,7 +53,7 @@ static Renderable createDeleteRender .render(); } - static Renderable> createBatchInsertRenderer( + static Renderer> createBatchInsertRenderer( BatchInsertModel batchInsertModel) { return renderingStrategy -> BatchInsertRenderer.withBatchInsertModel(batchInsertModel) .withRenderingStrategy(renderingStrategy) @@ -61,7 +61,7 @@ static Renderable> createBatchInsertRender .render(); } - static Renderable createGeneralInsertRenderer( + static Renderer createGeneralInsertRenderer( GeneralInsertModel generalInsertModel, StatementConfiguration statementConfiguration) { return renderingStrategy -> GeneralInsertRenderer.withInsertModel(generalInsertModel) .withStatementConfiguration(statementConfiguration) @@ -70,7 +70,7 @@ static Renderable createGener .render(); } - static Renderable> createInsertRenderer( + static Renderer> createInsertRenderer( InsertModel insertModel) { return renderingStrategy -> InsertRenderer.withInsertModel(insertModel) .withRenderingStrategy(renderingStrategy) @@ -78,7 +78,7 @@ static Renderable> createInser .render(); } - static Renderable createInsertSelectRenderer( + static Renderer createInsertSelectRenderer( InsertSelectModel insertSelectModel, StatementConfiguration statementConfiguration) { return renderingStrategy -> InsertSelectRenderer.withInsertSelectModel(insertSelectModel) .withStatementConfiguration(statementConfiguration) @@ -87,7 +87,7 @@ static Renderable createInsert .render(); } - static Renderable> createMultiRowInsertRenderer( + static Renderer> createMultiRowInsertRenderer( MultiRowInsertModel multiRowInsertModel) { return renderingStrategy -> MultiRowInsertRenderer.withMultiRowInsertModel(multiRowInsertModel) .withRenderingStrategy(renderingStrategy) @@ -95,7 +95,7 @@ static Renderable> cre .render(); } - static Renderable createMultiSelectRenderer( + static Renderer createMultiSelectRenderer( MultiSelectModel multiSelectModel, StatementConfiguration statementConfiguration) { return renderingStrategy -> new MultiSelectRenderer.Builder() .withMultiSelectModel(multiSelectModel) @@ -105,7 +105,7 @@ static Renderable createMultiSelectR .render(); } - static Renderable createSelectRenderer( + static Renderer createSelectRenderer( SelectModel selectModel) { return renderingContext -> SelectRenderer.withSelectModel(selectModel) .withRenderingContext(renderingContext) @@ -113,7 +113,7 @@ static Renderable createSelectRendere .render(); } - static Renderable createUpdateRenderer( + static Renderer createUpdateRenderer( UpdateModel updateModel, StatementConfiguration statementConfiguration) { return renderingStrategy -> UpdateRenderer.withUpdateModel(updateModel) .withStatementConfiguration(statementConfiguration)