码迷,mamicode.com
首页 > 编程语言 > 详细

spring boot加mybatis使用Map返回时,当值为空时属性也会没有(转)

时间:2018-05-07 11:48:09      阅读:425      评论:0      收藏:0      [点我收藏+]

标签:属性   prope   tis   解决   call   nbsp   boot   设置   bat   

使用spring boot加mybatis时,设置Map返回,当值为空时属性也会没有,就会报错

在application.properties中加入下面配置,将会解决这个问题。

 

#当查询数据为空时字段返回为null,不加这个查询数据为空时,字段将被隐藏
mybatis.configuration.call-setters-on-nulls=true

spring boot加mybatis使用Map返回时,当值为空时属性也会没有(转)

标签:属性   prope   tis   解决   call   nbsp   boot   设置   bat   

原文地址:https://www.cnblogs.com/supiaopiao/p/9001571.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!