mybatis中`resultType`返回值为`java.util.Map`返回结果字段值为null的字段会直接不显示怎么办
mybatis中resultType
返回值为java.util.Map
返回结果字段值为null的字段会直接不显示怎么办?
mybatis:
mapper-locations: classpath:/mapper/*.xml
configuration:
map-underscore-to-camel-case: true
call-setters-on-nulls: true #mybatis返回类型为map返回字段值为null的字段
配置一下mybatis的配置文件即可
call-setters-on-nulls: true #mybatis返回类型为map返回字段值为null的字段
将call-setters-on-nulls
改为true即可
还没有评论,来说两句吧...