From c7089b55b388ecf694e994540aadf652a3f4b3d2 Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Fri, 25 Aug 2023 14:54:37 +0800 Subject: [PATCH] =?UTF-8?q?remove:=20=E7=A7=BB=E9=99=A4=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E6=B3=9B=E5=9E=8B=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/query/QueryCondition.java | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/QueryCondition.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/QueryCondition.java index 375bc85a..a273bc51 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/QueryCondition.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/QueryCondition.java @@ -27,7 +27,6 @@ import com.mybatisflex.core.util.StringUtil; import java.lang.reflect.Array; import java.util.List; import java.util.function.BooleanSupplier; -import java.util.function.Predicate; public class QueryCondition implements CloneSupport { @@ -126,38 +125,6 @@ public class QueryCondition implements CloneSupport { return this; } - /** - *

动态条件构造。 - * - *

推荐将 {@link Predicate} 推断写在填写的值的后面,以确保泛型对应,例如: - *

{@code
-     * ACCOUNT.ID.in(idList, CollectionUtil::isNotEmpty);
-     * }
- * - * @see #when(boolean) - * @see #when(BooleanSupplier) - * @deprecated 由于 {@link QueryCondition} 中属性 {@link #value} 的类型为 Object - * 类型,没有使用泛型,所以该方法泛型推断可能会出现问题。 - */ - @Deprecated - @SuppressWarnings("unchecked") - public QueryCondition when(Predicate fn) { - Object val = this.value; - if ((SqlConsts.LIKE.equals(logic) || SqlConsts.NOT_LIKE.equals(logic)) - && val instanceof String) { - String valStr = (String) val; - if (valStr.startsWith(SqlConsts.PERCENT_SIGN)) { - valStr = valStr.substring(1); - } - if (valStr.endsWith(SqlConsts.PERCENT_SIGN)) { - valStr = valStr.substring(0, valStr.length() - 1); - } - val = valStr; - } - this.effective = fn.test((T) val); - return this; - } - public boolean checkEffective() { return effective; }