mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 16:48:24 +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
|
||||
protected DataSource getDataSource() {
|
||||
return new FlexDataSource(dsWrap.name(), dsWrap.raw());
|
||||
return new FlexDataSourcePlus(dsWrap.name(), dsWrap.raw());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user