diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/field/FieldQueryManager.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/field/FieldQueryManager.java index 59f586d2..35e16de4 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/field/FieldQueryManager.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/field/FieldQueryManager.java @@ -26,6 +26,8 @@ import com.mybatisflex.core.util.CollectionUtil; import java.lang.reflect.Array; import java.util.*; +import static com.mybatisflex.core.table.TableInfoFactory.defaultSupportColumnTypes; + /** * 属性查询管理。 * @@ -87,6 +89,8 @@ public class FieldQueryManager { Class componentType = filedType.getComponentType(); List objects = mapper.selectListByQueryAs(queryWrapper, componentType); value = getArrayValue(componentType, objects); + } else if (defaultSupportColumnTypes.contains(filedType)) { + value = mapper.selectObjectByQueryAs(queryWrapper, filedType); } else { value = mapper.selectOneByQueryAs(queryWrapper, filedType); // 循环查询嵌套类 diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfoFactory.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfoFactory.java index 5146439e..152d983b 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfoFactory.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfoFactory.java @@ -50,7 +50,7 @@ public class TableInfoFactory { private TableInfoFactory() { } - static final Set> defaultSupportColumnTypes = CollectionUtil.newHashSet( + public static final Set> defaultSupportColumnTypes = CollectionUtil.newHashSet( int.class, Integer.class, short.class, Short.class, long.class, Long.class,