Implementation of spring boot 2.0 mybatis mapper locations scanning multiple paths


Springboot 2.0 mybatis mapper locations scans multiple paths

Mapper locations scans multiple paths, separated by,

If mapper XML is configured asclasspath*It works better at the beginning

  mapper-locations: classpath*:mapper/*.xml,classpath*:com/urthink/upfs/**/*Mapper.xml
  type-aliases-package: com.urthink.upfs.springbootmybatis.entity
  #Identity: how MySQL # retrieves the primary key
  #Notempty: false #insert and update, whether to judge the string type! = ''
    #During automatic mapping, the data is named with an underscore, such as whether the "order_address" named field returned by the database is mapped to the "orderaddress" field of class. The default is false
    map-underscore-to-camel-case: true
    #Output SQL execution statements (log4j2 itself can output SQL statements)
    #log-impl: org. apache. ibatis. logging. stdout. Stdoutimpl # is a result set with

Maven packages resource files under the source package, such as XML

                <!-- <excludes>
                </excludes> -->

The above is my personal experience. I hope I can give you a reference, and I hope you can support developpaer.