reactive-mybatis-support
reactive-mybatis-support copied to clipboard
reactive mybatis support for reactive project using r2dbc
Reactive Mybatis Support
JDK/R2DBC-SPI/Spring-Boot Compatibility
- Refer to the table below to determine the appropriate version of
mybatis-r2dbcfor your project.
Exclude the
vprefix when using the version number.
| Compiled JDK | 8 | 11 | 17 |
|---|---|---|---|
| r2dbc-spi | 0.9.1.RELEASE |
1.0.0.RELEASE |
1.0.0.RELEASE |
| mybatis-r2dbc | -- | ||
| mybatis-r2dbc-generator | -- | ||
| mybatis-r2dbc-spring | -- | ||
| Spring Boot | [2.7.x,3.0.0) |
-- | [3.0.0,~) |
- The whole project
reactive-mybatis-support(2.x.x)is compiled withJDK8andSpringBoot(2.7.x), akar2dbc-spi(0.9.1.RELEASE) - The
mybatis-r2dbc(3.x.x)andmybatis-r2dbc-generator(3.x.x)are compiled withJDK11, akar2dbc-spi(1.0.0.RELEASE). - The
mybatis-r2dbc-spring(3.x.x)is compiled withJDK17andSpringBoot(3.x.x), akar2dbc-spi(1.0.0.RELEASE).
Instruction
- Reactive Mybatis Support is aimed to adapt original mybatis to reactive project (aka WebFlux/Reactor3) with r2dbc drivers.
mybatis-r2dbcmodule is inspired by linux-china/mybatis-r2dbc and based onmybatis3's original source code.mybatis-generatormodule is used to adaptmybatis-dynamic-sqlto reactive project.- Most of the MyBatis3 features are applicable, but there are a few features that are not supported:
- ❌ 1 . mybatis-plugin
- ❌ 2 . multi ResultSets or Results
- ❌ 3 . nested query with multi SQL statements
- ❌️ 4 . blocking java type (aka: InputStream .eg)
- For more usage instructions, please refer to the wiki: WIKI
Maven Central
- dependency
<dependencies>
<dependency>
<groupId>pro.chenggang</groupId>
<artifactId>mybatis-r2dbc</artifactId>
<version>${compatible-version}</version>
</dependency>
<dependency>
<groupId>pro.chenggang</groupId>
<artifactId>mybatis-r2dbc-generator</artifactId>
<version>${compatible-version}</version>
</dependency>
<dependency>
<groupId>pro.chenggang</groupId>
<artifactId>mybatis-r2dbc-spring</artifactId>
<version>${compatible-version}</version>
</dependency>
</dependencies>