mybatis配置mapperLocations多个路径

<property name="mapperLocations">
      <array>
          <value>classpath*:/mybatis-config.xml</value>
          <value>classpath*:/com/**/sqlmap-*.xml</value>
      </array>
</property>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
      <property name="mapperLocations">
          <array>
              <value>classpath:mybatis/mapper/*.xml</value>
              <value>classpath:mybatis/mapper/database/*.xml</value>
          </array>
      </property>
      <property name="dataSource" ref="dataSource"/>
      <property name="configLocation" value="classpath:mybatis/config/mybatis-config.xml"/>
</bean>
<property name="mapperLocations" >
     <list>
          <value>classpath*:/sqlmap/*.xml</value>
          <value>classpath*:/test/*.xml</value>
     </list>
</property>

 

    原文作者:MyBatis
    原文地址: https://www.cnblogs.com/henuyuxiang/p/6592813.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞