ngbatis
ngbatis copied to clipboard
能否支持自定义配置源
期望能增加自定义配置数据源的形式,而不是只能读取指定的property。 【目前】
private NebulaJdbcProperties getNebulaJdbcProperties(ConfigurableEnvironment environment) {
NebulaJdbcProperties nebulaJdbcProperties = new NebulaJdbcProperties();
return nebulaJdbcProperties.setHosts((String)Objects.requireNonNull(environment.getProperty("nebula.hosts"))).setUsername(environment.getProperty("nebula.username")).setPassword(environment.getProperty("nebula.password")).setSpace(environment.getProperty("nebula.space"));
}
private NebulaPoolConfig getNebulaPoolConfig(ConfigurableEnvironment environment) {
NebulaPoolConfig nebulaPoolConfig = (new NebulaPoolConfig()).setMinConnSize((Integer)environment.getProperty("nebula.pool-config.min-conn-size", Integer.class, 0)).setMaxConnSize((Integer)environment.getProperty("nebula.pool-config.max-conn-size", Integer.class, 10)).setTimeout((Integer)environment.getProperty("nebula.pool-config.timeout", Integer.class, 0)).setIdleTime((Integer)environment.getProperty("nebula.pool-config.idle-time", Integer.class, 0)).setIntervalIdle((Integer)environment.getProperty("nebula.pool-config.interval-idle", Integer.class, -1)).setWaitTime((Integer)environment.getProperty("nebula.pool-config.wait-time", Integer.class, 0));
return nebulaPoolConfig;
}