整合 Mybatis 源码,整合spring-r2dbc
chenggangpro opened this issue · 2 comments
chenggangpro commented
适配了Mybatis源码,麻烦大佬看一下是否可以可用。由于变更的文件较多,就没有PR。如果可以的话,会重新提PR过来。
地址 :https://github.com/chenggangpro/reactive-mybatis-support
分支:main
只进行了简单功能性测试(见测试用例)
适配过程中删除了Mybatis源码中一下未使用的类和代码,可能有多余代码没有删除干净
已测试的功能: (MySQL)
1 . 事物操作
2 . 参数解析,parameterMap
3 . resultType,resultMap,一对一,一对多结果集嵌套映射(<association/>
/<collection/>
)
4 . 返回自增主键
支持的功能:
- 1 . 参数解析
- 2 . Result解析(一对一,一对多等)
- 3 . 事物操作
- 4 . 通过适配器扩展r2dbc数据类型
不支持的功能
- 1 . 嵌套查询(nested query),在一个mapper方法上执行多条SQL
- 2 . 通过嵌套查询(nested query)返回主键
- 3 . 多个 ResultSet,没有测试存储过程
- 4 . 多ResultMap(只支持一个ResultMap或者嵌套的ResultMap)
- 5 . mybatis-plugin
- 6 . InputStream数据类型等阻塞类型
SyloYamtao commented
Nice!
chenggangpro commented
Reactive mybatis support (already in Maven Central
) has met the general business usage scenarios, including:
- 1 . Parameter parsing and mapping
- 2 . One-to-many associative relationships for result mapping
- 3 . Result mapping for one-to-one relationships
- 4 . Returning a generated key
- 5 . generated key by nested query (
@SelectKey
/<selectKey>
) - 6 . Manual transaction operation
- 7 . Adaptation of parameter binding placeholders for different r2dbc drivers
- 8 . SpringBoot transaction Integration
- 9 . Adaptation of r2dbc driver's placeholder dialect, including:
- mysql
- h2
- mssql
- postgresql
- oracle
More examples see reactive-mybatis-support-examples, Distinguish different databases by reactive-mybatis-support-examples
's branch:
- mysql
- h2
- mssql
- postgresql
- oracle