1
mirror of https://github.com/CarmJos/MineSQL.git synced 2026-06-05 00:48:16 +08:00

fix(init): 修复SQL配置的Initializer未被调用的问题。

This commit is contained in:
2023-04-17 00:49:46 +08:00
parent 40afd988e4
commit 62a8bc4629
9 changed files with 18 additions and 13 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
@@ -124,7 +124,7 @@ public class MineSQLCore implements IMineSQL {
}
@Override
public @NotNull SQLManagerImpl create(@NotNull String name, @NotNull SQLSourceConfig conf) {
public @NotNull SQLManagerImpl create(@NotNull String name, @NotNull SQLSourceConfig conf) throws Exception {
BeeDataSourceConfig config = new BeeDataSourceConfig();
config.setDriverClassName(conf.getDriverClassName());
config.setJdbcUrl(conf.getJdbcURL());
@@ -147,7 +147,12 @@ public class MineSQLCore implements IMineSQL {
Optional.ofNullable(conf.getSettings().getValidationTimeout()).ifPresent(config::setValidTestTimeout);
Optional.ofNullable(conf.getSettings().getValidationInterval()).ifPresent(config::setValidAssumeTime);
return create(name, config);
SQLManagerImpl manager = create(name, config);
if (conf.getInitializer() != null) {
conf.getInitializer().accept(manager);
}
return manager;
}
@Override