当先锋百科网

首页 1 2 3 4 5 6 7

mybatis怎么返回null值返回类型是个map?

创建Mybatis-config.xml123456789<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEconfigurationPUBLIC"-//mybatis.org//DTDConfig3.0//EN""http://mybatis.org/dtd/mybatis-3-config.dtd"><configuration><settings><!--当返回数据类型为map,设置callSettersOnNulls会把值为null的key也返回--><settingname="callSettersOnNulls"value="true"/></settings></configuration>在配置数据源的配置文件中,配置Mybatis的SqlSessionFactoryBean123456789<beanid="sqlSessionFactory"class="org.mybatis.spring.SqlSessionFactoryBean"><propertyname="dataSource"ref="dataSource"/><propertyname="configLocation"value="classpath:/META-INF/spring/mybatis-config.xml"/><propertyname="mapperLocations"><array> <value>classpath*:/yunnex/saofu/shop/beibao/mappe