mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
build: v1.7.6 release (^.^)YYa!!
This commit is contained in:
parent
820f143839
commit
2caa9ecef3
18
changes.md
18
changes.md
@ -2,6 +2,24 @@
|
||||
|
||||
查看 [全部代码贡献者](/zh/intro/what-is-mybatisflex.html#贡献者)。
|
||||
|
||||
## v1.7.5 20231223:
|
||||
- 新增:Db.selectFirstAndSecondColumnsAsMap 方法:查询结果的第一列作为 key,第二列作为 value,感谢 @617054137
|
||||
- 新增:方言添加添加权限处理统一入口 prepareAuth,感谢 @bf109f
|
||||
- 优化:在数组异常时不显示数组为空异常信息的问题,感谢 @Suomm
|
||||
- 优化:修改 QueryCondition 的类的相关错别字,感谢 @Suomm
|
||||
- 优化:升级 MyBatis 相关依赖到最新版本,感谢 @tocken
|
||||
- 修复:DB2 v10.5 不支持 offset 关键字进行分页的问题,感谢 @farukonfly
|
||||
- 修复:DB2 v10.5 不支持 Nulls First 或 Nulls Last 语法的问题,感谢 @farukonfly
|
||||
- 修复:FieldWrapper 对有泛型 Entity 进行部分更新时报错的问题,感谢 @617054137
|
||||
- 修复:Db.updateEntitiesBatch 更新部分字段时,在某些场景下报错的问题,感谢 @617054137
|
||||
- 修复:字段类型为 YearMonth,Year 等时更新出错的问题 #I8CGVM
|
||||
- 修复:main 方法直接调用 updateChain 方法构建 sql 时调用 toSQL 出错的问题 #I8NF9T
|
||||
- 测试:优化单元测试,移除 println,添加更多的断言,感谢 @mofan
|
||||
- 文档:添加 SpringBoot 3.2 版本启动失败解决办法,感谢 @Suomm
|
||||
- 文档:优化英文文档的相关内容,感谢 @mofan
|
||||
- 文档:更新 table 中的示例代码错误,感谢 @jtxfd_admin
|
||||
|
||||
|
||||
|
||||
## v1.7.5 20231124:
|
||||
- 修复:主键 ID 当传入空字符串时,调用 `insert` 方法不会依据 `@Id` 自动生成主键 id 的问题
|
||||
|
||||
@ -26,6 +26,7 @@ import com.mybatisflex.core.row.RowMapper;
|
||||
import com.mybatisflex.core.table.TableInfo;
|
||||
import com.mybatisflex.core.table.TableInfoFactory;
|
||||
import com.mybatisflex.core.util.ArrayUtil;
|
||||
import com.mybatisflex.core.util.ClassUtil;
|
||||
import org.apache.ibatis.javassist.util.proxy.ProxyObject;
|
||||
|
||||
import java.util.*;
|
||||
@ -245,13 +246,8 @@ public class RowSqlProvider {
|
||||
|
||||
FlexAssert.notNull(entity, "entity can not be null");
|
||||
|
||||
Class<?> entityClass = entity.getClass();
|
||||
//如果是代理mybatis代理对象
|
||||
if(entity instanceof ProxyObject){
|
||||
entityClass = entityClass.getSuperclass();
|
||||
}
|
||||
// 该 Mapper 是通用 Mapper 无法通过 ProviderContext 获取,直接使用 TableInfoFactory
|
||||
TableInfo tableInfo = TableInfoFactory.ofEntityClass(entityClass);
|
||||
TableInfo tableInfo = TableInfoFactory.ofEntityClass(ClassUtil.getUsefulClass(entity.getClass()));
|
||||
|
||||
// 执行 onUpdate 监听器
|
||||
tableInfo.invokeOnUpdateListener(entity);
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
package com.mybatisflex.core.util;
|
||||
|
||||
|
||||
import org.apache.ibatis.javassist.util.proxy.ProxyObject;
|
||||
|
||||
import java.lang.reflect.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -72,10 +74,13 @@ public class ClassUtil {
|
||||
return getJdkProxySuperClass(clazz);
|
||||
}
|
||||
|
||||
// if (ProxyObject.class.isAssignableFrom(clazz)){
|
||||
// return (Class<T>) clazz.getSuperclass();
|
||||
// }
|
||||
|
||||
//ControllerTest$ServiceTest$$EnhancerByGuice$$40471411#hello -------> Guice
|
||||
//com.demo.blog.Blog$$EnhancerByCGLIB$$69a17158 ----> CGLIB
|
||||
//io.jboot.test.app.TestAppListener_$$_jvstb9f_0 ------> javassist
|
||||
|
||||
final String name = clazz.getName();
|
||||
if (name.contains(ENHANCER_BY) || name.contains(JAVASSIST_BY)) {
|
||||
return (Class<T>) clazz.getSuperclass();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user