springboot 2.0 mybatis mapper-locations掃描多個路徑的實現(xiàn)
更新時間:2021年07月29日 09:45:52 作者:躁動的青年
這篇文章主要介紹了springboot 2.0 mybatis mapper-locations掃描多個路徑的實現(xiàn)方式,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
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:
#進行自動映射時,數(shù)據(jù)以下劃線命名,如數(shù)據(jù)庫返回的"order_address"命名字段是否映射為class的"orderAddress"字段。默認(rèn)為false
map-underscore-to-camel-case: true
# 輸出SQL執(zhí)行語句 (log4j2本身可以輸出sql語句)
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #這種帶結(jié)果集
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>
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
解決idea中svn提交時performing vcs refresh時間很長的問題
這篇文章主要介紹了解決idea中svn提交時performing vcs refresh時間很長的問題,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-09-09
JAVA將中文轉(zhuǎn)換為拼音簡單實現(xiàn)方法
拼音轉(zhuǎn)換是中文處理的常見需求,TinyPinyin、HanLP、pinyin4j是常用的本地拼音轉(zhuǎn)換庫,各有特點,開發(fā)者可根據(jù)具體需求選擇合適的拼音轉(zhuǎn)換工具,需要的朋友可以參考下2024-10-10

