diff --git a/CHANGELOG.md b/CHANGELOG.md
index cec9f683f..c65f2c09c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -82,6 +82,8 @@ Runtime behavior changes:
2. We have updated the "ParameterTypeConverter" used in Spring applications to maintain compatibility with Spring's
"Converter" interface. The primary change is that the framework will no longer call a type converter if the
input value is null. This should simplify the coding of converters and foster reuse with existing Spring converters.
+3. The "map" method on the "WhenPresent" conditions will accept a mapper function that may return a null value. The
+ conditions will now properly handle this outcome
### Other important changes:
diff --git a/pom.xml b/pom.xml
index cad1ea0b9..2f37f9c03 100644
--- a/pom.xml
+++ b/pom.xml
@@ -76,6 +76,8 @@
pom.xml,src/main/java,src/main/kotlin
src/test/java,src/test/kotlin
+
+ http://localhost:9000
official
1.20.6
diff --git a/src/main/java/org/mybatis/dynamic/sql/AbstractListValueCondition.java b/src/main/java/org/mybatis/dynamic/sql/AbstractListValueCondition.java
index 41c6a56e2..e178c6bf3 100644
--- a/src/main/java/org/mybatis/dynamic/sql/AbstractListValueCondition.java
+++ b/src/main/java/org/mybatis/dynamic/sql/AbstractListValueCondition.java
@@ -23,6 +23,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import org.jspecify.annotations.NonNull;
import org.mybatis.dynamic.sql.render.RenderedParameterInfo;
import org.mybatis.dynamic.sql.render.RenderingContext;
import org.mybatis.dynamic.sql.util.FragmentAndParameters;
@@ -113,7 +114,7 @@ public interface Filterable {
* @return this condition if renderable and the value matches the predicate, otherwise a condition
* that will not render.
*/
- AbstractListValueCondition filter(Predicate super T> predicate);
+ AbstractListValueCondition filter(Predicate super @NonNull T> predicate);
}
/**
@@ -138,6 +139,6 @@ public interface Mappable {
* @return a new condition with the result of applying the mapper to the value of this condition,
* if renderable, otherwise a condition that will not render.
*/
- AbstractListValueCondition map(Function super T, ? extends R> mapper);
+ AbstractListValueCondition map(Function super @NonNull T, ? extends R> mapper);
}
}
diff --git a/src/main/java/org/mybatis/dynamic/sql/AbstractNoValueCondition.java b/src/main/java/org/mybatis/dynamic/sql/AbstractNoValueCondition.java
index 20e6251d6..71daa7763 100644
--- a/src/main/java/org/mybatis/dynamic/sql/AbstractNoValueCondition.java
+++ b/src/main/java/org/mybatis/dynamic/sql/AbstractNoValueCondition.java
@@ -60,7 +60,8 @@ public interface Filterable {
* @param
* condition type - not used except for compilation compliance
*
- * @return this condition if renderable and the supplier returns true, otherwise a condition that will not render.
+ * @return this condition if renderable and the supplier returns true, otherwise a condition that will not
+ * render.
*/
AbstractNoValueCondition filter(BooleanSupplier booleanSupplier);
}
diff --git a/src/main/java/org/mybatis/dynamic/sql/AbstractSingleValueCondition.java b/src/main/java/org/mybatis/dynamic/sql/AbstractSingleValueCondition.java
index c16dbf08c..eb56eef39 100644
--- a/src/main/java/org/mybatis/dynamic/sql/AbstractSingleValueCondition.java
+++ b/src/main/java/org/mybatis/dynamic/sql/AbstractSingleValueCondition.java
@@ -21,6 +21,7 @@
import java.util.function.Predicate;
import java.util.function.Supplier;
+import org.jspecify.annotations.NonNull;
import org.mybatis.dynamic.sql.render.RenderedParameterInfo;
import org.mybatis.dynamic.sql.render.RenderingContext;
import org.mybatis.dynamic.sql.util.FragmentAndParameters;
@@ -88,7 +89,7 @@ public interface Filterable {
* @return this condition if renderable and the value matches the predicate, otherwise a condition
* that will not render.
*/
- AbstractSingleValueCondition filter(Predicate super T> predicate);
+ AbstractSingleValueCondition filter(Predicate super @NonNull T> predicate);
}
/**
@@ -113,6 +114,6 @@ public interface Mappable {
* @return a new condition with the result of applying the mapper to the value of this condition,
* if renderable, otherwise a condition that will not render.
*/
- AbstractSingleValueCondition map(Function super T, ? extends R> mapper);
+ AbstractSingleValueCondition map(Function super @NonNull T, ? extends R> mapper);
}
}
diff --git a/src/main/java/org/mybatis/dynamic/sql/AbstractTwoValueCondition.java b/src/main/java/org/mybatis/dynamic/sql/AbstractTwoValueCondition.java
index 6cceff16e..d409ffbb8 100644
--- a/src/main/java/org/mybatis/dynamic/sql/AbstractTwoValueCondition.java
+++ b/src/main/java/org/mybatis/dynamic/sql/AbstractTwoValueCondition.java
@@ -23,6 +23,7 @@
import java.util.function.Predicate;
import java.util.function.Supplier;
+import org.jspecify.annotations.NonNull;
import org.mybatis.dynamic.sql.render.RenderedParameterInfo;
import org.mybatis.dynamic.sql.render.RenderingContext;
import org.mybatis.dynamic.sql.util.FragmentAndParameters;
@@ -110,7 +111,7 @@ public interface Filterable {
* @return this condition if renderable and the values match the predicate, otherwise a condition
* that will not render.
*/
- AbstractTwoValueCondition filter(BiPredicate super T, ? super T> predicate);
+ AbstractTwoValueCondition filter(BiPredicate super @NonNull T, ? super @NonNull T> predicate);
/**
* If renderable and both values match the predicate, returns this condition. Else returns a condition
@@ -121,7 +122,7 @@ public interface Filterable {
* @return this condition if renderable and the values match the predicate, otherwise a condition
* that will not render.
*/
- AbstractTwoValueCondition filter(Predicate super T> predicate);
+ AbstractTwoValueCondition filter(Predicate super @NonNull T> predicate);
}
/**
@@ -147,8 +148,8 @@ public interface Mappable {
* @return a new condition with the result of applying the mappers to the values of this condition,
* if renderable, otherwise a condition that will not render.
*/
- AbstractTwoValueCondition map(Function super T, ? extends R> mapper1,
- Function super T, ? extends R> mapper2);
+ AbstractTwoValueCondition map(Function super @NonNull T, ? extends R> mapper1,
+ Function super @NonNull T, ? extends R> mapper2);
/**
* If renderable, apply the mapping to both values and return a new condition with the new values. Else return a
@@ -159,6 +160,6 @@ AbstractTwoValueCondition map(Function super T, ? extends R> mapper1,
* @return a new condition with the result of applying the mappers to the values of this condition,
* if renderable, otherwise a condition that will not render.
*/
- AbstractTwoValueCondition map(Function super T, ? extends R> mapper);
+ AbstractTwoValueCondition map(Function super @NonNull T, ? extends R> mapper);
}
}
diff --git a/src/main/java/org/mybatis/dynamic/sql/SqlBuilder.java b/src/main/java/org/mybatis/dynamic/sql/SqlBuilder.java
index 2f365de1e..9790633b0 100644
--- a/src/main/java/org/mybatis/dynamic/sql/SqlBuilder.java
+++ b/src/main/java/org/mybatis/dynamic/sql/SqlBuilder.java
@@ -21,6 +21,7 @@
import java.util.Objects;
import java.util.function.Supplier;
+import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;
import org.mybatis.dynamic.sql.delete.DeleteDSL;
import org.mybatis.dynamic.sql.delete.DeleteModel;
@@ -62,14 +63,18 @@
import org.mybatis.dynamic.sql.util.Buildable;
import org.mybatis.dynamic.sql.where.WhereDSL;
import org.mybatis.dynamic.sql.where.condition.IsBetween;
+import org.mybatis.dynamic.sql.where.condition.IsBetweenWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsEqualTo;
import org.mybatis.dynamic.sql.where.condition.IsEqualToColumn;
+import org.mybatis.dynamic.sql.where.condition.IsEqualToWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsEqualToWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsGreaterThan;
import org.mybatis.dynamic.sql.where.condition.IsGreaterThanColumn;
import org.mybatis.dynamic.sql.where.condition.IsGreaterThanOrEqualTo;
import org.mybatis.dynamic.sql.where.condition.IsGreaterThanOrEqualToColumn;
+import org.mybatis.dynamic.sql.where.condition.IsGreaterThanOrEqualToWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsGreaterThanOrEqualToWithSubselect;
+import org.mybatis.dynamic.sql.where.condition.IsGreaterThanWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsGreaterThanWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsIn;
import org.mybatis.dynamic.sql.where.condition.IsInCaseInsensitive;
@@ -80,13 +85,19 @@
import org.mybatis.dynamic.sql.where.condition.IsLessThanColumn;
import org.mybatis.dynamic.sql.where.condition.IsLessThanOrEqualTo;
import org.mybatis.dynamic.sql.where.condition.IsLessThanOrEqualToColumn;
+import org.mybatis.dynamic.sql.where.condition.IsLessThanOrEqualToWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsLessThanOrEqualToWithSubselect;
+import org.mybatis.dynamic.sql.where.condition.IsLessThanWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsLessThanWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsLike;
import org.mybatis.dynamic.sql.where.condition.IsLikeCaseInsensitive;
+import org.mybatis.dynamic.sql.where.condition.IsLikeCaseInsensitiveWhenPresent;
+import org.mybatis.dynamic.sql.where.condition.IsLikeWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsNotBetween;
+import org.mybatis.dynamic.sql.where.condition.IsNotBetweenWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsNotEqualTo;
import org.mybatis.dynamic.sql.where.condition.IsNotEqualToColumn;
+import org.mybatis.dynamic.sql.where.condition.IsNotEqualToWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsNotEqualToWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsNotIn;
import org.mybatis.dynamic.sql.where.condition.IsNotInCaseInsensitive;
@@ -95,6 +106,8 @@
import org.mybatis.dynamic.sql.where.condition.IsNotInWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsNotLike;
import org.mybatis.dynamic.sql.where.condition.IsNotLikeCaseInsensitive;
+import org.mybatis.dynamic.sql.where.condition.IsNotLikeCaseInsensitiveWhenPresent;
+import org.mybatis.dynamic.sql.where.condition.IsNotLikeWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsNotNull;
import org.mybatis.dynamic.sql.where.condition.IsNull;
@@ -634,11 +647,11 @@ static IsEqualToColumn isEqualTo(BasicColumn column) {
return IsEqualToColumn.of(column);
}
- static IsEqualTo isEqualToWhenPresent(@Nullable T value) {
- return value == null ? IsEqualTo.empty() : IsEqualTo.of(value);
+ static IsEqualToWhenPresent isEqualToWhenPresent(@Nullable T value) {
+ return IsEqualToWhenPresent.of(value);
}
- static IsEqualTo isEqualToWhenPresent(Supplier<@Nullable T> valueSupplier) {
+ static IsEqualToWhenPresent isEqualToWhenPresent(Supplier<@Nullable T> valueSupplier) {
return isEqualToWhenPresent(valueSupplier.get());
}
@@ -658,11 +671,11 @@ static IsNotEqualToColumn isNotEqualTo(BasicColumn column) {
return IsNotEqualToColumn.of(column);
}
- static IsNotEqualTo isNotEqualToWhenPresent(@Nullable T value) {
- return value == null ? IsNotEqualTo.empty() : IsNotEqualTo.of(value);
+ static IsNotEqualToWhenPresent isNotEqualToWhenPresent(@Nullable T value) {
+ return IsNotEqualToWhenPresent.of(value);
}
- static IsNotEqualTo isNotEqualToWhenPresent(Supplier<@Nullable T> valueSupplier) {
+ static IsNotEqualToWhenPresent isNotEqualToWhenPresent(Supplier<@Nullable T> valueSupplier) {
return isNotEqualToWhenPresent(valueSupplier.get());
}
@@ -682,11 +695,11 @@ static IsGreaterThanColumn isGreaterThan(BasicColumn column) {
return IsGreaterThanColumn.of(column);
}
- static IsGreaterThan isGreaterThanWhenPresent(@Nullable T value) {
- return value == null ? IsGreaterThan.empty() : IsGreaterThan.of(value);
+ static IsGreaterThanWhenPresent isGreaterThanWhenPresent(@Nullable T value) {
+ return IsGreaterThanWhenPresent.of(value);
}
- static IsGreaterThan isGreaterThanWhenPresent(Supplier<@Nullable T> valueSupplier) {
+ static IsGreaterThanWhenPresent isGreaterThanWhenPresent(Supplier<@Nullable T> valueSupplier) {
return isGreaterThanWhenPresent(valueSupplier.get());
}
@@ -707,11 +720,12 @@ static IsGreaterThanOrEqualToColumn isGreaterThanOrEqualTo(BasicColumn co
return IsGreaterThanOrEqualToColumn.of(column);
}
- static IsGreaterThanOrEqualTo isGreaterThanOrEqualToWhenPresent(@Nullable T value) {
- return value == null ? IsGreaterThanOrEqualTo.empty() : IsGreaterThanOrEqualTo.of(value);
+ static IsGreaterThanOrEqualToWhenPresent isGreaterThanOrEqualToWhenPresent(@Nullable T value) {
+ return IsGreaterThanOrEqualToWhenPresent.of(value);
}
- static IsGreaterThanOrEqualTo isGreaterThanOrEqualToWhenPresent(Supplier<@Nullable T> valueSupplier) {
+ static IsGreaterThanOrEqualToWhenPresent isGreaterThanOrEqualToWhenPresent(
+ Supplier<@Nullable T> valueSupplier) {
return isGreaterThanOrEqualToWhenPresent(valueSupplier.get());
}
@@ -731,11 +745,11 @@ static IsLessThanColumn isLessThan(BasicColumn column) {
return IsLessThanColumn.of(column);
}
- static IsLessThan isLessThanWhenPresent(@Nullable T value) {
- return value == null ? IsLessThan.empty() : IsLessThan.of(value);
+ static IsLessThanWhenPresent isLessThanWhenPresent(@Nullable T value) {
+ return IsLessThanWhenPresent.of(value);
}
- static IsLessThan isLessThanWhenPresent(Supplier<@Nullable T> valueSupplier) {
+ static IsLessThanWhenPresent isLessThanWhenPresent(Supplier<@Nullable T> valueSupplier) {
return isLessThanWhenPresent(valueSupplier.get());
}
@@ -755,20 +769,20 @@ static IsLessThanOrEqualToColumn isLessThanOrEqualTo(BasicColumn column)
return IsLessThanOrEqualToColumn.of(column);
}
- static IsLessThanOrEqualTo isLessThanOrEqualToWhenPresent(@Nullable T value) {
- return value == null ? IsLessThanOrEqualTo.empty() : IsLessThanOrEqualTo.of(value);
+ static IsLessThanOrEqualToWhenPresent isLessThanOrEqualToWhenPresent(@Nullable T value) {
+ return IsLessThanOrEqualToWhenPresent.of(value);
}
- static IsLessThanOrEqualTo isLessThanOrEqualToWhenPresent(Supplier<@Nullable T> valueSupplier) {
+ static IsLessThanOrEqualToWhenPresent isLessThanOrEqualToWhenPresent(Supplier<@Nullable T> valueSupplier) {
return isLessThanOrEqualToWhenPresent(valueSupplier.get());
}
@SafeVarargs
- static IsIn isIn(T... values) {
+ static IsIn isIn(@NonNull T... values) {
return IsIn.of(values);
}
- static IsIn isIn(Collection values) {
+ static IsIn isIn(Collection<@NonNull T> values) {
return IsIn.of(values);
}
@@ -782,15 +796,15 @@ static IsInWhenPresent isInWhenPresent(@Nullable T... values) {
}
static IsInWhenPresent isInWhenPresent(@Nullable Collection<@Nullable T> values) {
- return values == null ? IsInWhenPresent.empty() : IsInWhenPresent.of(values);
+ return IsInWhenPresent.of(values);
}
@SafeVarargs
- static IsNotIn isNotIn(T... values) {
+ static IsNotIn isNotIn(@NonNull T... values) {
return IsNotIn.of(values);
}
- static IsNotIn isNotIn(Collection values) {
+ static IsNotIn isNotIn(Collection<@NonNull T> values) {
return IsNotIn.of(values);
}
@@ -804,22 +818,22 @@ static IsNotInWhenPresent isNotInWhenPresent(@Nullable T... values) {
}
static IsNotInWhenPresent isNotInWhenPresent(@Nullable Collection<@Nullable T> values) {
- return values == null ? IsNotInWhenPresent.empty() : IsNotInWhenPresent.of(values);
+ return IsNotInWhenPresent.of(values);
}
static IsBetween.Builder isBetween(T value1) {
return IsBetween.isBetween(value1);
}
- static IsBetween.Builder isBetween(Supplier valueSupplier1) {
+ static IsBetween.Builder isBetween(Supplier<@NonNull T> valueSupplier1) {
return isBetween(valueSupplier1.get());
}
- static IsBetween.WhenPresentBuilder isBetweenWhenPresent(@Nullable T value1) {
- return IsBetween.isBetweenWhenPresent(value1);
+ static IsBetweenWhenPresent.Builder isBetweenWhenPresent(@Nullable T value1) {
+ return IsBetweenWhenPresent.isBetweenWhenPresent(value1);
}
- static IsBetween.WhenPresentBuilder isBetweenWhenPresent(Supplier<@Nullable T> valueSupplier1) {
+ static IsBetweenWhenPresent.Builder isBetweenWhenPresent(Supplier<@Nullable T> valueSupplier1) {
return isBetweenWhenPresent(valueSupplier1.get());
}
@@ -827,15 +841,15 @@ static IsNotBetween.Builder isNotBetween(T value1) {
return IsNotBetween.isNotBetween(value1);
}
- static IsNotBetween.Builder isNotBetween(Supplier valueSupplier1) {
+ static IsNotBetween.Builder isNotBetween(Supplier<@NonNull T> valueSupplier1) {
return isNotBetween(valueSupplier1.get());
}
- static IsNotBetween.WhenPresentBuilder isNotBetweenWhenPresent(@Nullable T value1) {
- return IsNotBetween.isNotBetweenWhenPresent(value1);
+ static IsNotBetweenWhenPresent.Builder isNotBetweenWhenPresent(@Nullable T value1) {
+ return IsNotBetweenWhenPresent.isNotBetweenWhenPresent(value1);
}
- static IsNotBetween.WhenPresentBuilder isNotBetweenWhenPresent(Supplier<@Nullable T> valueSupplier1) {
+ static IsNotBetweenWhenPresent.Builder isNotBetweenWhenPresent(Supplier<@Nullable T> valueSupplier1) {
return isNotBetweenWhenPresent(valueSupplier1.get());
}
@@ -848,11 +862,11 @@ static IsLike isLike(Supplier valueSupplier) {
return isLike(valueSupplier.get());
}
- static IsLike isLikeWhenPresent(@Nullable T value) {
- return value == null ? IsLike.empty() : IsLike.of(value);
+ static IsLikeWhenPresent isLikeWhenPresent(@Nullable T value) {
+ return IsLikeWhenPresent.of(value);
}
- static IsLike isLikeWhenPresent(Supplier<@Nullable T> valueSupplier) {
+ static IsLikeWhenPresent isLikeWhenPresent(Supplier<@Nullable T> valueSupplier) {
return isLikeWhenPresent(valueSupplier.get());
}
@@ -864,11 +878,11 @@ static IsNotLike isNotLike(Supplier valueSupplier) {
return isNotLike(valueSupplier.get());
}
- static IsNotLike isNotLikeWhenPresent(@Nullable T value) {
- return value == null ? IsNotLike.empty() : IsNotLike.of(value);
+ static IsNotLikeWhenPresent isNotLikeWhenPresent(@Nullable T value) {
+ return IsNotLikeWhenPresent.of(value);
}
- static IsNotLike isNotLikeWhenPresent(Supplier<@Nullable T> valueSupplier) {
+ static IsNotLikeWhenPresent isNotLikeWhenPresent(Supplier<@Nullable T> valueSupplier) {
return isNotLikeWhenPresent(valueSupplier.get());
}
@@ -890,11 +904,12 @@ static IsLikeCaseInsensitive isLikeCaseInsensitive(Supplier valu
return isLikeCaseInsensitive(valueSupplier.get());
}
- static IsLikeCaseInsensitive isLikeCaseInsensitiveWhenPresent(@Nullable String value) {
- return value == null ? IsLikeCaseInsensitive.empty() : IsLikeCaseInsensitive.of(value);
+ static IsLikeCaseInsensitiveWhenPresent isLikeCaseInsensitiveWhenPresent(@Nullable String value) {
+ return IsLikeCaseInsensitiveWhenPresent.of(value);
}
- static IsLikeCaseInsensitive isLikeCaseInsensitiveWhenPresent(Supplier<@Nullable String> valueSupplier) {
+ static IsLikeCaseInsensitiveWhenPresent isLikeCaseInsensitiveWhenPresent(
+ Supplier<@Nullable String> valueSupplier) {
return isLikeCaseInsensitiveWhenPresent(valueSupplier.get());
}
@@ -906,11 +921,11 @@ static IsNotLikeCaseInsensitive isNotLikeCaseInsensitive(Supplier isNotLikeCaseInsensitiveWhenPresent(@Nullable String value) {
- return value == null ? IsNotLikeCaseInsensitive.empty() : IsNotLikeCaseInsensitive.of(value);
+ static IsNotLikeCaseInsensitiveWhenPresent isNotLikeCaseInsensitiveWhenPresent(@Nullable String value) {
+ return IsNotLikeCaseInsensitiveWhenPresent.of(value);
}
- static IsNotLikeCaseInsensitive isNotLikeCaseInsensitiveWhenPresent(
+ static IsNotLikeCaseInsensitiveWhenPresent isNotLikeCaseInsensitiveWhenPresent(
Supplier<@Nullable String> valueSupplier) {
return isNotLikeCaseInsensitiveWhenPresent(valueSupplier.get());
}
@@ -929,7 +944,7 @@ static IsInCaseInsensitiveWhenPresent isInCaseInsensitiveWhenPresent(@Nu
static IsInCaseInsensitiveWhenPresent isInCaseInsensitiveWhenPresent(
@Nullable Collection<@Nullable String> values) {
- return values == null ? IsInCaseInsensitiveWhenPresent.empty() : IsInCaseInsensitiveWhenPresent.of(values);
+ return IsInCaseInsensitiveWhenPresent.of(values);
}
static IsNotInCaseInsensitive isNotInCaseInsensitive(String... values) {
@@ -946,8 +961,7 @@ static IsNotInCaseInsensitiveWhenPresent isNotInCaseInsensitiveWhenPrese
static IsNotInCaseInsensitiveWhenPresent isNotInCaseInsensitiveWhenPresent(
@Nullable Collection<@Nullable String> values) {
- return values == null ? IsNotInCaseInsensitiveWhenPresent.empty() :
- IsNotInCaseInsensitiveWhenPresent.of(values);
+ return IsNotInCaseInsensitiveWhenPresent.of(values);
}
// order by support
diff --git a/src/main/java/org/mybatis/dynamic/sql/delete/DeleteDSL.java b/src/main/java/org/mybatis/dynamic/sql/delete/DeleteDSL.java
index 3724e5395..aeebc5498 100644
--- a/src/main/java/org/mybatis/dynamic/sql/delete/DeleteDSL.java
+++ b/src/main/java/org/mybatis/dynamic/sql/delete/DeleteDSL.java
@@ -120,7 +120,7 @@ public DeleteDSL limit(long limit) {
return limitWhenPresent(limit);
}
- public DeleteDSL limitWhenPresent(Long limit) {
+ public DeleteDSL limitWhenPresent(@Nullable Long limit) {
return DeleteDSL.this.limitWhenPresent(limit);
}
diff --git a/src/main/java/org/mybatis/dynamic/sql/update/UpdateDSL.java b/src/main/java/org/mybatis/dynamic/sql/update/UpdateDSL.java
index f33bbc074..fbac97595 100644
--- a/src/main/java/org/mybatis/dynamic/sql/update/UpdateDSL.java
+++ b/src/main/java/org/mybatis/dynamic/sql/update/UpdateDSL.java
@@ -202,7 +202,7 @@ public UpdateDSL limit(long limit) {
return limitWhenPresent(limit);
}
- public UpdateDSL limitWhenPresent(Long limit) {
+ public UpdateDSL limitWhenPresent(@Nullable Long limit) {
return UpdateDSL.this.limitWhenPresent(limit);
}
diff --git a/src/main/java/org/mybatis/dynamic/sql/util/mybatis3/CommonSelectMapper.java b/src/main/java/org/mybatis/dynamic/sql/util/mybatis3/CommonSelectMapper.java
index 1faa0bd05..8f0f350ee 100644
--- a/src/main/java/org/mybatis/dynamic/sql/util/mybatis3/CommonSelectMapper.java
+++ b/src/main/java/org/mybatis/dynamic/sql/util/mybatis3/CommonSelectMapper.java
@@ -22,6 +22,7 @@
import java.util.function.Function;
import org.apache.ibatis.annotations.SelectProvider;
+import org.jspecify.annotations.Nullable;
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
@@ -49,7 +50,7 @@ public interface CommonSelectMapper {
/**
* Select a single row as a Map of values. The row may have any number of columns.
* The Map key will be the column name as returned from the
- * database (may be aliased if an alias is specified in the select statement). Map entries will be
+ * database (the key will be aliased if an alias is specified in the select statement). Map entries will be
* of data types determined by the JDBC driver. MyBatis will call ResultSet.getObject() to retrieve
* values from the ResultSet. Reference your JDBC driver documentation to learn about type mappings
* for your specific database.
@@ -58,7 +59,7 @@ public interface CommonSelectMapper {
* @return A Map containing the row values.
*/
@SelectProvider(type = SqlProviderAdapter.class, method = "select")
- Map selectOneMappedRow(SelectStatementProvider selectStatement);
+ @Nullable Map selectOneMappedRow(SelectStatementProvider selectStatement);
/**
* Select a single row of values and then convert the values to a custom type. This is similar
@@ -74,16 +75,17 @@ public interface CommonSelectMapper {
* @param the datatype of the converted object
* @return the converted object
*/
- default R selectOne(SelectStatementProvider selectStatement,
+ default @Nullable R selectOne(SelectStatementProvider selectStatement,
Function