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>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM