spring boot加mybatis使用Map返回值设置

当使用spring boot加mybatis时,设置Map返回,当值为空或是null时,返回的字段不会加载到map中

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

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

猜你喜欢

转载自www.cnblogs.com/xueershewang/p/9055566.html