Skip to content

Commit

Permalink
chore(merge): release-10.2.0 into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bonita-ci committed Sep 19, 2024
2 parents 8afb211 + 65f17f4 commit cec96ee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import org.bonitasoft.platform.exception.PlatformException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
Expand All @@ -67,18 +66,10 @@ public class ConfigurationServiceImpl implements ConfigurationService {

private final TransactionTemplate transactionTemplate;

@Value("${db.vendor}")
private String dbVendor;
private final String dbVendor;

@Autowired
public ConfigurationServiceImpl(JdbcTemplate jdbcTemplate,
TransactionTemplate transactionTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.transactionTemplate = transactionTemplate;
}

public ConfigurationServiceImpl(JdbcTemplate jdbcTemplate,
TransactionTemplate transactionTemplate, String dbVendor) {
TransactionTemplate transactionTemplate, @Value("${db.vendor}") String dbVendor) {
this.jdbcTemplate = jdbcTemplate;
this.transactionTemplate = transactionTemplate;
this.dbVendor = dbVendor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public class PlatformSetup {

private final DataSource dataSource;

@Value("${db.vendor}")
protected String dbVendor;

private Path initialConfigurationFolder;
Expand All @@ -97,11 +96,12 @@ public class PlatformSetup {
PlatformSetup.class.getClassLoader());

public PlatformSetup(ScriptExecutor scriptExecutor, ConfigurationService configurationService,
VersionService versionService, DataSource dataSource) {
VersionService versionService, DataSource dataSource, @Value("${db.vendor}") String dbVendor) {
this.scriptExecutor = scriptExecutor;
this.configurationService = configurationService;
this.versionService = versionService;
this.dataSource = dataSource;
this.dbVendor = dbVendor;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,16 @@ public PlatformSetup createNewPlatformSetup(DataSource dataSource, String dbVend
final DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager(dataSource);
TransactionTemplate transactionTemplate = new TransactionTemplate(dataSourceTransactionManager);
VersionService versionService = new VersionServiceImpl(jdbcTemplate);
return createPlatformSetup(createScriptExecutor(dataSource, dbVendor, versionService),
new ConfigurationServiceImpl(jdbcTemplate, transactionTemplate, dbVendor), versionService, dataSource);
return createPlatformSetup(
createScriptExecutor(dataSource, dbVendor, versionService),
new ConfigurationServiceImpl(jdbcTemplate, transactionTemplate, dbVendor),
versionService, dataSource, dbVendor);
}

protected PlatformSetup createPlatformSetup(ScriptExecutor scriptExecutor,
ConfigurationService configurationService, VersionService versionService, DataSource dataSource) {
return new PlatformSetup(scriptExecutor, configurationService, versionService, dataSource);
ConfigurationService configurationService, VersionService versionService, DataSource dataSource,
String dbVendor) {
return new PlatformSetup(scriptExecutor, configurationService, versionService, dataSource, dbVendor);
}

protected ScriptExecutor createScriptExecutor(DataSource dataSource, String dbVendor,
Expand Down

0 comments on commit cec96ee

Please sign in to comment.