Updated to files to fit the Standard.

This commit is contained in:
Glenn Renfro
2022-07-25 11:41:43 -04:00
parent 39908bb499
commit 76a5d12136
200 changed files with 2839 additions and 4125 deletions

View File

@@ -20,7 +20,6 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.task.configuration.EnableTask;
/**
* @author Michael Minella
*/

View File

@@ -33,4 +33,5 @@ public class CustomTaskConfigurer extends DefaultTaskConfigurer {
public CustomTaskConfigurer(@Qualifier("secondDataSource") DataSource dataSource) {
super(dataSource);
}
}

View File

@@ -36,15 +36,12 @@ public class EmbeddedDataSourceConfiguration {
@Bean
public DataSource dataSource() {
return new EmbeddedDatabaseBuilder()
.setType(EmbeddedDatabaseType.HSQL)
.build();
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.HSQL).build();
}
@Bean
public DataSource secondDataSource() {
return new EmbeddedDatabaseBuilder()
.setType(EmbeddedDatabaseType.H2)
.build();
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2).build();
}
}

View File

@@ -31,6 +31,7 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
/**
* Creates two data sources that use external databases.
*
* @author Glenn Renfro
*/
@Configuration(proxyBeanMethods = false)
@@ -52,20 +53,19 @@ public class ExternalDataSourceConfiguration {
@Bean(name = "springDataSource")
@Primary
public DataSource dataSource(@Qualifier("springDataSourceProperties")DataSourceProperties springDataSourceProperties) {
return DataSourceBuilder.create().driverClassName(springDataSourceProperties.getDriverClassName()).
url(springDataSourceProperties.getUrl()).
password(springDataSourceProperties.getPassword()).
username(springDataSourceProperties.getUsername()).
build();
public DataSource dataSource(
@Qualifier("springDataSourceProperties") DataSourceProperties springDataSourceProperties) {
return DataSourceBuilder.create().driverClassName(springDataSourceProperties.getDriverClassName())
.url(springDataSourceProperties.getUrl()).password(springDataSourceProperties.getPassword())
.username(springDataSourceProperties.getUsername()).build();
}
@Bean
public DataSource secondDataSource(@Qualifier("secondDataSourceProperties") DataSourceProperties secondDataSourceProperties) {
return DataSourceBuilder.create().driverClassName(secondDataSourceProperties.getDriverClassName()).
url(secondDataSourceProperties.getUrl()).
password(secondDataSourceProperties.getPassword()).
username(secondDataSourceProperties.getUsername()).
build();
public DataSource secondDataSource(
@Qualifier("secondDataSourceProperties") DataSourceProperties secondDataSourceProperties) {
return DataSourceBuilder.create().driverClassName(secondDataSourceProperties.getDriverClassName())
.url(secondDataSourceProperties.getUrl()).password(secondDataSourceProperties.getPassword())
.username(secondDataSourceProperties.getUsername()).build();
}
}

View File

@@ -39,7 +39,7 @@ public class SampleCommandLineRunner implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
System.out.println("There are " + this.dataSources.size() +
" DataSources within this application");
System.out.println("There are " + this.dataSources.size() + " DataSources within this application");
}
}