mybatis-flex-solon-plugin:mybatisFlex 配置的数据源,增加同步到应用上下文的处理

This commit is contained in:
noear 2024-12-17 00:30:46 +08:00
parent 7c942cb3cc
commit 7e48db05d7

View File

@ -87,7 +87,11 @@ public class XPluginImpl implements Plugin {
String dsName = entry.getKey(); String dsName = entry.getKey();
DataSource ds = new DataSourceBuilder(entry.getValue()).build(); DataSource ds = new DataSourceBuilder(entry.getValue()).build();
BeanWrap bw = context.wrap(dsName, ds, dsName.equals(flexProperties.getDefaultDatasourceKey())); BeanWrap bw = context.wrap(dsName, ds, dsName.equals(flexProperties.getDefaultDatasourceKey()));
loadDs(context, bw); context.putWrap(dsName, bw);
if (bw.typed()) {
context.putWrap(DataSource.class, bw);
}
context.wrapPublish(bw);
} }
} }
} }