mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-14 02:55:07 +08:00
【依赖】mybatis-plus from 3.5.5 to 3.5.7
This commit is contained in:
@ -185,8 +185,8 @@ public interface BaseMapperX<T> extends MPJBaseMapper<T> {
|
||||
return Db.updateBatchById(entities, size);
|
||||
}
|
||||
|
||||
default Boolean insertOrUpdate(T entity) {
|
||||
return Db.saveOrUpdate(entity);
|
||||
default boolean insertOrUpdate(T entity) {
|
||||
return Db.saveOrUpdate(entity);
|
||||
}
|
||||
|
||||
default Boolean insertOrUpdateBatch(Collection<T> collection) {
|
||||
|
@ -1,31 +0,0 @@
|
||||
package cn.iocoder.yudao.framework.mybatis.core.type;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 参考 {@link com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler} 实现
|
||||
* 在我们将字符串反序列化为 Set 并且泛型为 Long 时,如果每个元素的数值太小,会被处理成 Integer 类型,导致可能存在隐性的 BUG。
|
||||
*
|
||||
* 例如说哦,SysUserDO 的 postIds 属性
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public class JsonLongSetTypeHandler extends AbstractJsonTypeHandler<Object> {
|
||||
|
||||
private static final TypeReference<Set<Long>> TYPE_REFERENCE = new TypeReference<Set<Long>>(){};
|
||||
|
||||
@Override
|
||||
protected Object parse(String json) {
|
||||
return JsonUtils.parseObject(json, TYPE_REFERENCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String toJson(Object obj) {
|
||||
return JsonUtils.toJsonString(obj);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user