717 Star 2.8K Fork 762

abel533 / Mapper

 / 详情

3.5.0版本设置annotationAsSimpleType后枚举类型依然无法被解析

已完成
创建于  
2018-01-09 20:24

“新增 annotationAsSimpleType 参数,默认 false,设置为 true 后会把枚举作为简单类型对待,需要配合 useSimpleType = true 使用。”

未验证通过:
EntityHelper类中:

for (EntityField field : fields) {
            //如果启用了简单类型,就做简单类型校验,如果不是简单类型,直接跳过
            //3.5.0 如果启用了枚举作为简单类型,就不会自动忽略枚举类型
            if (config.isUseSimpleType() &&
                    !(SimpleTypeUtil.isSimpleType(field.getJavaType())
                            ||
                            (config.isAnnotationAsSimpleType() && Annotation.class.isAssignableFrom(field.getJavaType())))) {
                continue;
            }
            processField(entityTable, style, field, config.getWrapKeyword());
        }

config.isUseSimpleType() = true

SimpleTypeUtil.isSimpleType(field.getJavaType() = false

config.isAnnotationAsSimpleType() = true

Annotation.class.isAssignableFrom(field.getJavaType()) - false

true && !(false || (true && false)) = true 直接跳过了

评论 (1)

守望 创建了任务
abel533 关闭了任务

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
8363 free 1578914558
Java
1
https://gitee.com/free/Mapper.git
git@gitee.com:free/Mapper.git
free
Mapper
Mapper

搜索帮助