【Spring】【1】mybatis spring的自动扫描配置

正文:

    
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="com.rockbb.facility.common.dao.mapper, com.rockbb.facility.weixin.dao.mapper" />
        
        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
    bean>

    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSourceLocal" />
        <property name="mapperLocations">
            <list>
                <value>classpath:com/rockbb/facility/common/dao/mapper/*.xmlvalue>
                <value>classpath:com/rockbb/facility/weixin/dao/mapper/*.xmlvalue>
            list>
        property>
    bean>

其实后面发现可以用通配符*号。。。

参考博客:

多个mapper location时, mybatis spring的自动扫描配置 - Milton - 博客园
https://www.cnblogs.com/milton/p/4497355.html

转载于:https://www.cnblogs.com/huashengweilong/p/10924948.html

你可能感兴趣的:(【Spring】【1】mybatis spring的自动扫描配置)