mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-12-06 17:18:54 +08:00
Condition增加构造方法支持BETWEEN(issue#4041@Github)
This commit is contained in:
parent
54e12a68cf
commit
763f672236
@ -9,6 +9,7 @@
|
|||||||
* 【core 】 `MapUtil`增加`removeByValue`和`removeIf`方法
|
* 【core 】 `MapUtil`增加`removeByValue`和`removeIf`方法
|
||||||
* 【core 】 `ObjectUtil`增加`apply`方法
|
* 【core 】 `ObjectUtil`增加`apply`方法
|
||||||
* 【core 】 `ReferenceUtil`增加`get`方法
|
* 【core 】 `ReferenceUtil`增加`get`方法
|
||||||
|
* 【db 】 `Condition`增加构造方法支持BETWEEN(issue#4041@Github)
|
||||||
|
|
||||||
### 🐞Bug修复
|
### 🐞Bug修复
|
||||||
* 【core 】 修复`ReflectUtil`中因class和Method关联导致的缓存无法回收问题(issue#4039@Github)
|
* 【core 】 修复`ReflectUtil`中因class和Method关联导致的缓存无法回收问题(issue#4039@Github)
|
||||||
|
|||||||
@ -127,7 +127,12 @@ public class Condition extends CloneSupport<Condition> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构造
|
* 构造LIKE value条件,支持:
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link LikeType#StartWith}:LIKE value%</li>
|
||||||
|
* <li>{@link LikeType#EndWith}:LIKE %value</li>
|
||||||
|
* <li>{@link LikeType#Contains}:LIKE %value%</li>
|
||||||
|
* </ul>
|
||||||
*
|
*
|
||||||
* @param field 字段
|
* @param field 字段
|
||||||
* @param value 值
|
* @param value 值
|
||||||
@ -138,6 +143,21 @@ public class Condition extends CloneSupport<Condition> {
|
|||||||
this.operator = OPERATOR_LIKE;
|
this.operator = OPERATOR_LIKE;
|
||||||
this.value = SqlUtil.buildLikeValue(value, likeType, false);
|
this.value = SqlUtil.buildLikeValue(value, likeType, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造BETWEEN leftValue and rightValue条件
|
||||||
|
*
|
||||||
|
* @param field 字段
|
||||||
|
* @param leftValue 左值
|
||||||
|
* @param rightValue 右值
|
||||||
|
* @since 5.8.41
|
||||||
|
*/
|
||||||
|
public Condition(final String field, final Object leftValue, final Object rightValue){
|
||||||
|
this.field = field;
|
||||||
|
this.operator = OPERATOR_BETWEEN;
|
||||||
|
this.value = leftValue;
|
||||||
|
this.secondValue = rightValue;
|
||||||
|
}
|
||||||
// --------------------------------------------------------------- Constructor end
|
// --------------------------------------------------------------- Constructor end
|
||||||
|
|
||||||
// --------------------------------------------------------------- Getters and Setters start
|
// --------------------------------------------------------------- Getters and Setters start
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user