mybatis查询出来的字段的值为null,驼峰字段
2017-09-14 11:04
411 查看
mybatis查询出来的数据为null,驼峰字段
昨天遇到奇葩问题。开发环境一直好好的。
到了测试环境,就是流程跑不通。
3个伙伴排查了3个小时。
终于定位到问题的地方。
数据库的字段明明有值。
bean get的值就是为null。
最后发现,单单词的字段值不为空,多单词下划线链接的字段,值为空。
最后去看配置文件:
mybatis: mapper-locations: classpath:mybatis/mapper/*.xml type-aliases-package: com.shanlin.mybatis ##开启打印sql logging: level: debug
发现驼峰的没有了
mybatis: mapper-locations: classpath:mybatis/mapper/*.xml type-aliases-package: com.shanlin.mybatis ##开启驼峰映射 configuration: map-underscore-to-camel-case: true ##开启打印sql logging: level: debug
相关文章推荐
- Mybatis框架实体类字段与数据库表字段不一致导致查询该字段的值一直为null
- t-sql操作符中,不等号(!=,<>),查询出来的结果集不包含有当前字段为null的数据
- 使用mybatis查询sql注入到 map 中,唯空字段 也获取出来
- springboot+mybatis MyBatis查询返回Map时设置值为null的字段没有在结果集中
- mybatis查询类型为int的字段,返回null的异常
- myBatis 常见问题(一)查询结果字段为null
- mybatis使用char类型字段查询oracle数据库时结果返回null
- mybatis 使用oracle char 字段查询返回结果总是null
- 解决mybatis使用char类型字段查询oracle数据库时结果返回null问题
- MyBatis查询返回Map时设置值为null的字段也在结果集中
- mybatis 使用oracle char 字段查询返回结果总是null
- mybatis查询,返回类型为HashMap,字段为null时没返回
- mybatis查询类型为int的字段,返回null的异常
- mybatis查询类型为int的字段,返回null的异常
- Spring boot + MyBatis 查询返回Map时设置值为null的字段也在结果集中
- mybatis查询类型为int的字段,返回null的异常
- hibernate 查询Page 只要有一个字段为null 查出来的整条数据都为null
- mybatis同一个搜索框对多个字段进行模糊查询
- Mybatis返回HashMap时,某个字段值为null时,不会保存key
- MySQL 字段值为 null,但查询时用 is null 没用的问题