mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 09:38:26 +08:00
添加 solon 事务支持
This commit is contained in:
parent
4c5d7af23b
commit
d48cf80f8b
@ -0,0 +1,27 @@
|
|||||||
|
package com.mybatisflex.solon.integration;
|
||||||
|
|
||||||
|
import com.mybatisflex.core.datasource.FlexDataSource;
|
||||||
|
import org.noear.solon.data.datasource.RoutingDataSource;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用与 solon 的事务对接
|
||||||
|
*
|
||||||
|
* @author noear
|
||||||
|
* @since 2.8
|
||||||
|
*/
|
||||||
|
public class FlexDataSourcePlus extends FlexDataSource implements RoutingDataSource {
|
||||||
|
public FlexDataSourcePlus(String dataSourceKey, DataSource dataSource) {
|
||||||
|
super(dataSourceKey, dataSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FlexDataSourcePlus(String dataSourceKey, DataSource dataSource, boolean needDecryptDataSource) {
|
||||||
|
super(dataSourceKey, dataSource, needDecryptDataSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSource determineCurrentTarget() {
|
||||||
|
return getDataSource();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -66,7 +66,7 @@ public class MybatisAdapterFlex extends MybatisAdapterDefault {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected DataSource getDataSource() {
|
protected DataSource getDataSource() {
|
||||||
return new FlexDataSource(dsWrap.name(), dsWrap.raw());
|
return new FlexDataSourcePlus(dsWrap.name(), dsWrap.raw());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
<spring.version>5.3.27</spring.version>
|
<spring.version>5.3.27</spring.version>
|
||||||
<spring-boot.version>2.7.11</spring-boot.version>
|
<spring-boot.version>2.7.11</spring-boot.version>
|
||||||
<solon.version>2.5.3</solon.version>
|
<solon.version>2.8.4</solon.version>
|
||||||
|
|
||||||
<junit.version>4.13.2</junit.version>
|
<junit.version>4.13.2</junit.version>
|
||||||
<testcontainers.version>1.19.3</testcontainers.version>
|
<testcontainers.version>1.19.3</testcontainers.version>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user