您的位置:首页 > 其它

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息