mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
fix: 修复fieldMapping 基础类型查询null的情况
This commit is contained in:
parent
ea83639365
commit
6a072a57ba
@ -26,6 +26,8 @@ import com.mybatisflex.core.util.CollectionUtil;
|
|||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static com.mybatisflex.core.table.TableInfoFactory.defaultSupportColumnTypes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 属性查询管理。
|
* 属性查询管理。
|
||||||
*
|
*
|
||||||
@ -87,6 +89,8 @@ public class FieldQueryManager {
|
|||||||
Class<?> componentType = filedType.getComponentType();
|
Class<?> componentType = filedType.getComponentType();
|
||||||
List<?> objects = mapper.selectListByQueryAs(queryWrapper, componentType);
|
List<?> objects = mapper.selectListByQueryAs(queryWrapper, componentType);
|
||||||
value = getArrayValue(componentType, objects);
|
value = getArrayValue(componentType, objects);
|
||||||
|
} else if (defaultSupportColumnTypes.contains(filedType)) {
|
||||||
|
value = mapper.selectObjectByQueryAs(queryWrapper, filedType);
|
||||||
} else {
|
} else {
|
||||||
value = mapper.selectOneByQueryAs(queryWrapper, filedType);
|
value = mapper.selectOneByQueryAs(queryWrapper, filedType);
|
||||||
// 循环查询嵌套类
|
// 循环查询嵌套类
|
||||||
|
|||||||
@ -50,7 +50,7 @@ public class TableInfoFactory {
|
|||||||
private TableInfoFactory() {
|
private TableInfoFactory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
static final Set<Class<?>> defaultSupportColumnTypes = CollectionUtil.newHashSet(
|
public static final Set<Class<?>> defaultSupportColumnTypes = CollectionUtil.newHashSet(
|
||||||
int.class, Integer.class,
|
int.class, Integer.class,
|
||||||
short.class, Short.class,
|
short.class, Short.class,
|
||||||
long.class, Long.class,
|
long.class, Long.class,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user