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