您的位置:首页 > 移动开发

Spring配置扫描mybatis的mapper文件注意:

2015-05-07 11:53 405 查看
一般会将不业务的mapper文件放到不同的包中:



spring配置扫描就需要配置下面的方式(两个*):

<!-- mybatis文件配置,扫描所有mapper文件 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"
p:dataSource-ref="dataSource" p:configLocation="classpath:conf/mybatis-config.xml"
p:mapperLocations="classpath:mapper/**/*.xml" />
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: