mybatis查询出来的字段的值为null,驼峰字段

来源:互联网 发布:数据库服务器cpu 要求 编辑:程序博客网 时间:2024/06/03 11:19

mybatis查询出来的数据为null,驼峰字段

昨天遇到奇葩问题。
开发环境一直好好的。
到了测试环境,就是流程跑不通。

3个伙伴排查了3个小时。
终于定位到问题的地方。
数据库的字段明明有值。
bean get的值就是为null。
最后发现,单单词的字段值不为空,多单词下划线链接的字段,值为空。
最后去看配置文件:
mybatis:  mapper-locations: classpath:mybatis/mapper/*.xml  type-aliases-package: com.shanlin.mybatis  ##开启打印sqllogging:  level: debug

发现驼峰的没有了委屈
mybatis:  mapper-locations: classpath:mybatis/mapper/*.xml  type-aliases-package: com.shanlin.mybatis  ##开启驼峰映射  configuration:    map-underscore-to-camel-case: true  ##开启打印sqllogging:  level: debug


阅读全文
0 0
原创粉丝点击