码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2015-05-07 14:09:38      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:

一般会将不业务的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" />

 

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

标签:

原文地址:http://www.cnblogs.com/firebata/p/4484416.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!