mapper文件中resultType中引入实体类,查询结果为空解决方案

现象:在mapper文件中resultType中引入实体类,但是查询结果为null.

原因:Java实体类中命名规范是采用驼峰命名的,和数据库中命名规范不一致

解决方案:在springBoot中application.properties中添加如下配置即可

                    mybatis.configuration.map-underscore-to-camel-case=true

posted @ 2020-04-12 11:10  lsaac  阅读(1230)  评论(0)    收藏  举报