springboot 2.0 mybatis mapper-locations扫描多个路径

mapper-locations扫描多个路径,中间以,分开,

如果mapper.xml在源码包下,配置成classpath*开头比较好使

mybatis:
  mapper-locations: classpath*:mapper/*.xml,classpath*:**/*Mapper.xml
  type-aliases-package: com.urthink.upfs.springbootmybatis.entity
  #IDENTITY: MYSQL #取回主键的方式
  #notEmpty: false #insert和update中,是否判断字符串类型!=''
  configuration:
    #进行自动映射时,数据以下划线命名,如数据库返回的"order_address"命名字段是否映射为class的"orderAddress"字段。默认为false
    map-underscore-to-camel-case: true
    # 输出SQL执行语句 (log4j2本身可以输出sql语句)
    #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #这种带结果集

maven 打包源码包下的资源文件,如xml
https://blog.csdn.net/haveqing/article/details/86624255

猜你喜欢

转载自blog.csdn.net/haveqing/article/details/86624055