springboot 2.0 mybatis mapper-locations掃描多個路徑的實現
更新時間:2021年07月29日 09:45:52 作者:躁動的青年
這篇文章主要介紹了springboot 2.0 mybatis mapper-locations掃描多個路徑的實現方式,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
springboot 2.0 mybatis mapper-locations掃描多個路徑
mapper-locations掃描多個路徑,中間以,分開,
如果mapper.xml在源碼包下,配置成classpath*開頭比較好使
mybatis:
mapper-locations: classpath*:mapper/*.xml,classpath*:com/urthink/upfs/**/*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執(zhí)行語句 (log4j2本身可以輸出sql語句)
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #這種帶結果集
maven 打包源碼包下的資源文件,如xml
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<!-- <excludes>
<exclude>**/*.properties</exclude>
<exclude>**/*.xml</exclude>
</excludes> -->
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.yml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
以上為個人經驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關文章
springboot jpaRepository為何一定要對Entity序列化
這篇文章主要介紹了springboot jpaRepository為何一定要對Entity序列化,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2021-12-12

