一般会将不业务的mapper文件放到不同的包中:

Spring配置扫描mybatis的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" />

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2022-01-17
  • 2022-12-23
  • 2022-02-28
猜你喜欢
  • 2021-11-25
  • 2022-12-23
  • 2021-07-26
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
相关资源
相似解决方案