mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
doc: 更新 QueryColumnBehavior 配置。
This commit is contained in:
parent
fa28e0e7fa
commit
b23760f7ca
@ -1024,12 +1024,7 @@ QueryWrapper query2 = QueryWrapper.create()
|
|||||||
此时,我们可以通过配置 QueryColumnBehavior 来自定义忽略的值。如下的代码会自动忽略 `null` 和 `空字符串`:
|
此时,我们可以通过配置 QueryColumnBehavior 来自定义忽略的值。如下的代码会自动忽略 `null` 和 `空字符串`:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
QueryColumnBehavior.setIgnoreFunction(new Predicate<Object>() {
|
QueryColumnBehavior.setIgnoreFunction(o -> o == null || "".equals(o));
|
||||||
@Override
|
|
||||||
public boolean test(Object o) {
|
|
||||||
return "".equals(o);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
```
|
```
|
||||||
|
|
||||||
另外,在某些场景下,开发者希望在构建 QueryWrapper 中,如果传入的值是集合或数组,则使用 `in` 逻辑,否则使用 `=`(等于)
|
另外,在某些场景下,开发者希望在构建 QueryWrapper 中,如果传入的值是集合或数组,则使用 `in` 逻辑,否则使用 `=`(等于)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user