Search in sources :

Example 1 with DataSourceInitializer

use of org.springframework.jdbc.datasource.init.DataSourceInitializer in project Activiti by Activiti.

the class DatabaseInititializer method dataSourceInitializer.

@Bean
public DataSourceInitializer dataSourceInitializer() {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
Also used : DataSourceInitializer(org.springframework.jdbc.datasource.init.DataSourceInitializer) Bean(org.springframework.context.annotation.Bean)

Example 2 with DataSourceInitializer

use of org.springframework.jdbc.datasource.init.DataSourceInitializer in project spring-data-jdbc by spring-projects.

the class DataSourceConfiguration method initializer.

@Bean
DataSourceInitializer initializer() {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource());
    String[] activeProfiles = environment.getActiveProfiles();
    String profile = activeProfiles.length == 0 ? "" : activeProfiles[0];
    ClassPathResource script = new ClassPathResource(TestUtils.createScriptName(testClass, profile));
    ResourceDatabasePopulator populator = new ResourceDatabasePopulator(script);
    customizePopulator(populator);
    initializer.setDatabasePopulator(populator);
    return initializer;
}
Also used : ResourceDatabasePopulator(org.springframework.jdbc.datasource.init.ResourceDatabasePopulator) DataSourceInitializer(org.springframework.jdbc.datasource.init.DataSourceInitializer) ClassPathResource(org.springframework.core.io.ClassPathResource) Bean(org.springframework.context.annotation.Bean)

Example 3 with DataSourceInitializer

use of org.springframework.jdbc.datasource.init.DataSourceInitializer in project spring-security by spring-projects.

the class JdbcUserDetailsManagerConfigurer method getDataSourceInit.

private DataSourceInitializer getDataSourceInit() {
    DataSourceInitializer dsi = new DataSourceInitializer();
    dsi.setDatabasePopulator(getDatabasePopulator());
    dsi.setDataSource(dataSource);
    return dsi;
}
Also used : DataSourceInitializer(org.springframework.jdbc.datasource.init.DataSourceInitializer)

Aggregations

DataSourceInitializer (org.springframework.jdbc.datasource.init.DataSourceInitializer)3 Bean (org.springframework.context.annotation.Bean)2 ClassPathResource (org.springframework.core.io.ClassPathResource)1 ResourceDatabasePopulator (org.springframework.jdbc.datasource.init.ResourceDatabasePopulator)1