From bd75feef719652f2a78d3d6e08e11afc496dbf80 Mon Sep 17 00:00:00 2001 From: Jeff Butler Date: Mon, 20 May 2024 10:50:12 -0400 Subject: [PATCH 01/11] Type --- src/site/markdown/docs/conditions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/site/markdown/docs/conditions.md b/src/site/markdown/docs/conditions.md index b7fde71bf..d5683f206 100644 --- a/src/site/markdown/docs/conditions.md +++ b/src/site/markdown/docs/conditions.md @@ -203,7 +203,7 @@ case String values to enable case-insensitive queries. There are extension point mapping if you so desire. Starting with version 1.5.2, we made a change to the rendering rules for the "in" conditions. This was done to limit the -danger of conditions failing to render and thus affecting more rows than expected. For the base conditions ("isIn", +danger of conditions failing to render and thus affecting more rows than expected. For the base conditions ("isIn", "isNotIn", etc.), if the list of values is empty, then the condition will still render, but the resulting SQL will be invalid and will cause a runtime exception. We believe this is the safest outcome. For example, suppose a DELETE statement was coded as follows: @@ -220,7 +220,7 @@ This statement will be rendered as follows: delete from foo where status = ? and id in () ``` -This will cause a runtime error due to invalid SQL, but it eliminates the possibility of deleting ALLs rows with +This will cause a runtime error due to invalid SQL, but it eliminates the possibility of deleting ALL rows with active status. If you want to allow the "in" condition to drop from the SQL if the list is empty, then use the "inWhenPresent" condition. From 785ea41b898637e3dbbd583bbbe0eb23af6bd04e Mon Sep 17 00:00:00 2001 From: Jeff Butler Date: Mon, 20 May 2024 10:56:47 -0400 Subject: [PATCH 02/11] Replace "record" with "row" --- .../dynamic/sql/ParameterTypeConverter.java | 2 +- .../dynamic/sql/render/RenderingStrategy.java | 4 +- .../sql/update/UpdateDSLCompleter.java | 2 +- .../sql/util/mybatis3/CommonInsertMapper.java | 2 +- .../examples/animal/data/AnimalDataTest.java | 86 +++---- src/test/java/examples/array/ArrayTest.java | 8 +- .../custom_render/CustomRenderingTest.java | 24 +- .../mybatis/GeneratedAlwaysMapperTest.java | 102 ++++----- .../always/mybatis/PersonMapperTest.java | 10 +- .../generated/always/spring/SpringTest.java | 98 ++++---- .../examples/simple/PersonMapperTest.java | 200 ++++++++--------- .../examples/spring/PersonTemplateTest.java | 212 +++++++++--------- src/test/java/issues/gh324/NameService.java | 32 +-- .../gh324/spring/SpringNameService.java | 24 +- .../sql/insert/InsertStatementTest.java | 48 ++-- .../sql/mybatis3/InsertStatementTest.java | 24 +- .../mybatis3/canonical/GeneratedAlwaysTest.kt | 8 +- .../mybatis3/canonical/PersonMapperTest.kt | 50 ++--- .../custom/render/KCustomRenderingTest.kt | 14 +- ...CanonicalSpringKotlinTemplateDirectTest.kt | 10 +- .../canonical/CanonicalSpringKotlinTest.kt | 24 +- 21 files changed, 492 insertions(+), 492 deletions(-) diff --git a/src/main/java/org/mybatis/dynamic/sql/ParameterTypeConverter.java b/src/main/java/org/mybatis/dynamic/sql/ParameterTypeConverter.java index 3868f4d4b..7df7572b1 100644 --- a/src/main/java/org/mybatis/dynamic/sql/ParameterTypeConverter.java +++ b/src/main/java/org/mybatis/dynamic/sql/ParameterTypeConverter.java @@ -32,7 +32,7 @@ * Existing converters may be reused if they are marked with this additional interface. * *

The converter is only used for parameters in a parameter map. It is not used for result set processing. - * It is also not used for insert statements that are based on an external record class. The converter will be called + * It is also not used for insert statements that are based on an external row class. The converter will be called * in the following circumstances: * *