springboot值mybatis 別名等配置


在application配置文件中添加如下:

mybatis:
  #該配置替換在sql-config-map中的typeAliases配置
  type-aliases-package: com.ww.wwta.model
  config-location: classpath:config/sql-map-config.xml
  # 該配置不能同時與sql-config-map里的mappers存在
  mapper-locations: classpath:config/mapper/*.xml

說明:

1、type-aliases-package: com.ww.wwta.model 該配置等效在mybatis配置文件中加:
<typeAliases>
    <typeAlias     alias="xxModel" type="com.xx.model.xxModel"/>
</typeAliases>
2、mapper-locations: classpath:config/mapper/*.xml類似在mybatis配置中加:
<mappers>
     <mapper resource="com.xx.mapper.xxMapper"></mapper>
</mappers>
 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM