码迷,mamicode.com
首页 > 编程语言 > 详细

springboot值mybatis 别名等配置

时间:2018-10-24 01:05:44      阅读:698      评论:0      收藏:0      [点我收藏+]

标签:config   typealias   col   mod   pac   pack   alias   mybatis   path   

在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>
 
 

springboot值mybatis 别名等配置

标签:config   typealias   col   mod   pac   pack   alias   mybatis   path   

原文地址:https://www.cnblogs.com/kingsonfu/p/9840326.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!