<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="typeAliasesPackage" value="com.zhidian3g.nextad.domain" />
<property name="mapperLocations" value="classpath:mybatisMapperFile/*Mapper.xml />
</bean>
当属性"mapperLocations"没有配置默认mapper.xml匹配文件跟
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!--basePackage指定要扫描的包,在此包之下的映射器都会被 搜索到。可指定多个包,包与包之间用逗号或分号分隔 -->
<property name="basePackage" value="com.zhidian3g.nextad.dao" />
</bean>
属性"basePackage"包名一致:即路径"classpath:com/zhidian3g/nextad/dao/*Mapper.xml"
<property name="dataSource" ref="dataSource" />
<property name="typeAliasesPackage" value="com.zhidian3g.nextad.domain" />
<property name="mapperLocations" value="classpath:mybatisMapperFile/*Mapper.xml />
</bean>
当属性"mapperLocations"没有配置默认mapper.xml匹配文件跟
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!--basePackage指定要扫描的包,在此包之下的映射器都会被 搜索到。可指定多个包,包与包之间用逗号或分号分隔 -->
<property name="basePackage" value="com.zhidian3g.nextad.dao" />
</bean>
属性"basePackage"包名一致:即路径"classpath:com/zhidian3g/nextad/dao/*Mapper.xml"