当前位置: 首页 > news >正文

SpringBoot复习:(44)MyBatisAutoConfiguration

在这里插入图片描述
可以看到MyBatisAutoConfiguration引入了MyBatisProperties这个属性:
在这里插入图片描述
在这里插入图片描述
MyBatisAutoConfiguration中配置了一个SqlSessionFactoryBean,代码如下:
在这里插入图片描述
在这里插入图片描述
可以配置mybatis-config.xml,需要配置文件里指定:
mybatis.config-location=classpath:/mybatis-config.xml
同样可配置MyBatis的xml mapper(如果不用注解mapper):
mybatis.mapper-locations=classpath:cn/edu/tju/mapper/*Mapper.xml

也就是application.properties可以和mybatis-config.xml共同来对SqlSessionFactory进行配置。

可以通过application.properties的MyBatis的Configuration下的属性或者自定义ConfigurationCustomizer来配置哪些mybatis-config.xml settings中配置的属性。
例如:mybatis.configuration.mapUnderscoreToCamelCase=true。
只有不启用mybatis-config.xml时,mybatis.configuration或者ConfigurationCustomizer的配置才生效

http://www.lryc.cn/news/122772.html

相关文章:

  • SpringBoot校验,DTO文件中常用的注解应用案例.
  • Qt 窗口随鼠标移动效果
  • 大数据Flink(五十九):Flink on Yarn的三种部署方式介绍以及注意
  • mac-右键-用VSCode打开
  • tkinter+爬虫+pygame实现音乐播放器
  • css 实现 html 元素内文字水平垂直居中的N种方法
  • 数据结构-队列的实现(C语言版)
  • Vue.js 生命周期详解
  • 矩阵定理复习记录
  • Jenkins+Docker+SpringCloud微服务持续集成项目优化和微服务集群
  • 认识 spring 中的事务 与 事务的传播机制
  • PHP中的16个危险函数
  • 11、Nvidia显卡驱动、CUDA、cuDNN、Anaconda及Tensorflow Pytorch版本
  • 将数据库文件压缩并上传到文件服务器
  • docker — 容器网络
  • 腾讯面试题:使用Redis分布式锁可能会出现哪些问题?
  • 直接在html中引入Vue.js的cdn来实现Vue3的组合式API
  • YAPi在线接口文档简单案例(结合Vue前端Demo)
  • Java基础篇--Runtime类
  • 数字后端笔试题(1)DCG后congestion问题
  • 数据结构:交换排序
  • SpringBoot复习:(42)WebServerCustomizer的customize方法是在哪里被调用的?
  • 年至年的选择仿elementui的样式
  • 分类过程中的一种遮挡现象
  • 下一代服务架构:单体架构-->分布式架构-->微服务(DDD)-->软件定义架构(SDF with GraphEngine)
  • excel 之 VBA
  • 【数学建模】--聚类模型
  • css3新增选择器总结
  • 0基础学C#笔记10:归并排序法
  • nlohmann json:通过for遍历object和array