Mybatis 配置多个 mapperLocation

来源:互联网 发布:程序员论坛排行榜 编辑:程序博客网 时间:2024/06/11 07:27
<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>
阅读全文
0 0