mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
v1.4.1 release (^.^)YYa!!
This commit is contained in:
parent
c98776645f
commit
0498e7584b
@ -43,9 +43,7 @@ in alimaven (http://maven.aliyun.com/nexus/content/groups/public/)
|
|||||||
HikariCP 的 5.x 版本。
|
HikariCP 的 5.x 版本。
|
||||||
- 2、主动添加了 MyBatis 或者 `mybatis-spring-boot-starter` 的依赖,导致版本不匹配。使用 SpringBoot
|
- 2、主动添加了 MyBatis 或者 `mybatis-spring-boot-starter` 的依赖,导致版本不匹配。使用 SpringBoot
|
||||||
的情况下,应该引用 `mybatis-flex-spring-boot-starter` 就可以了,不需要再添加其他 MyBatis 依赖。
|
的情况下,应该引用 `mybatis-flex-spring-boot-starter` 就可以了,不需要再添加其他 MyBatis 依赖。
|
||||||
- 3、使用了 `druid-spring-boot-starter` 依赖,导致 flex 的 DataSource 无法被接管。应该使用 `druid`
|
- 3、使用了 `MyBatis-Plus` 或者 `pagehelper-spring-boot-starter` 而被这些框架优先初始化 MyBatis, MyBatis-Flex 未得到初始化。
|
||||||
就可以了,不要用 `druid-spring-boot-starter`。
|
|
||||||
- 4、使用了 `MyBatis-Plus` 或者 `pagehelper-spring-boot-starter` 而被这些框架优先初始化 MyBatis, MyBatis-Flex 未得到初始化。
|
|
||||||
|
|
||||||
## SpringBoot 项目,启动报错 Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
|
## SpringBoot 项目,启动报错 Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
|
||||||
|
|
||||||
@ -126,31 +124,6 @@ spring:
|
|||||||
> 若把数据源配置到 `mybatis-flex.datasource` 下,使用 mybatis-flex 的数据源发现机制,
|
> 若把数据源配置到 `mybatis-flex.datasource` 下,使用 mybatis-flex 的数据源发现机制,
|
||||||
> 使用 druid 则可以不用配置 type,更多文档参考:[多数据源章节](./core/multi-datasource.md)。
|
> 使用 druid 则可以不用配置 type,更多文档参考:[多数据源章节](./core/multi-datasource.md)。
|
||||||
|
|
||||||
## 使用 `druid-spring-boot-starter`,出现无法启动 或者 数据源识别错误的问题
|
|
||||||
|
|
||||||
在 MyBatis-Flex 不能使用 "druid-spring-boot-starter" 依赖,只能使用 "druid" 。
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba</groupId>
|
|
||||||
<artifactId>druid-spring-boot-starter</artifactId>
|
|
||||||
<version>${druid.version}</version>
|
|
||||||
</dependency>
|
|
||||||
```
|
|
||||||
|
|
||||||
需要把以上的依赖,修改如下:
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba</groupId>
|
|
||||||
<artifactId>druid</artifactId>
|
|
||||||
<version>${druid.version}</version>
|
|
||||||
</dependency>
|
|
||||||
```
|
|
||||||
|
|
||||||
> 原因是:druid-spring-boot-starter 内的 DruidDataSourceAutoConfigure 会去自动加载 spring.datasource 下的配置,当使用 MyBatis-Flex 的多数据源时,
|
|
||||||
> 这个配置已经不存在了。
|
|
||||||
|
|
||||||
## 与 PageHelper 集成出现错误
|
## 与 PageHelper 集成出现错误
|
||||||
|
|
||||||
在社区中,一些老的项目在使用到了开源项目 PageHelper,用于解决 xml 的分页问题,在和 MyBatis-flex 整合使用中,出现了一些错误,
|
在社区中,一些老的项目在使用到了开源项目 PageHelper,用于解决 xml 的分页问题,在和 MyBatis-flex 整合使用中,出现了一些错误,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user