Java 类org.springframework.jdbc.datasource.init.DataSourceInitializer 实例源码

项目:jdbc    文件:PgcopySinkConfiguration.java   
@ConditionalOnProperty("pgcopy.initialize")
@Bean
public DataSourceInitializer nonBootDataSourceInitializer(DataSource dataSource, ResourceLoader resourceLoader) {
    DataSourceInitializer dataSourceInitializer = new DataSourceInitializer();
    dataSourceInitializer.setDataSource(dataSource);
    ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
    databasePopulator.setIgnoreFailedDrops(true);
    dataSourceInitializer.setDatabasePopulator(databasePopulator);
    if ("true".equals(properties.getInitialize())) {
        databasePopulator.addScript(new DefaultInitializationScriptResource(properties.getTableName(),
                properties.getColumns()));
    } else {
        databasePopulator.addScript(resourceLoader.getResource(properties.getInitialize()));
    }
    return dataSourceInitializer;
}
项目:jdbc    文件:JdbcSinkConfiguration.java   
@ConditionalOnProperty("jdbc.initialize")
@Bean
public DataSourceInitializer nonBootDataSourceInitializer(DataSource dataSource, ResourceLoader resourceLoader) {
    DataSourceInitializer dataSourceInitializer = new DataSourceInitializer();
    dataSourceInitializer.setDataSource(dataSource);
    ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
    databasePopulator.setIgnoreFailedDrops(true);
    dataSourceInitializer.setDatabasePopulator(databasePopulator);
    if ("true".equals(properties.getInitialize())) {
        databasePopulator.addScript(new DefaultInitializationScriptResource(properties.getTableName(),
                properties.getColumnsMap().keySet()));
    }
    else {
        databasePopulator.addScript(resourceLoader.getResource(properties.getInitialize()));
    }
    return dataSourceInitializer;
}
项目:class-guard    文件:JdbcNamespaceIntegrationTests.java   
@Test
public void testCreateAndDestroy() throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
            "org/springframework/jdbc/config/jdbc-destroy-config.xml");
    try {
        DataSource dataSource = context.getBean(DataSource.class);
        JdbcTemplate template = new JdbcTemplate(dataSource);
        assertEquals(1, template.queryForInt("select count(*) from T_TEST"));
        context.getBean(DataSourceInitializer.class).destroy();
        expected.expect(BadSqlGrammarException.class); // Table has been dropped
        assertEquals(1, template.queryForInt("select count(*) from T_TEST"));
    }
    finally {
        context.close();
    }
}
项目:Intro-to-Spring-Hadoop    文件:Application.java   
@Bean
DataSourceInitializer hiveInitializer(final DataSource dataSource) {
    final String ddl = "create external table if not exists tweetdata (value STRING) LOCATION '" + input + "'";
    final DataSourceInitializer dsi = new DataSourceInitializer();
    dsi.setDataSource(dataSource);
    dsi.setDatabasePopulator(new DatabasePopulator() {
        @Override
        public void populate(Connection conn) throws SQLException,
                ScriptException {
            Statement st = conn.createStatement();
            st.execute(ddl);
            st.close();
        }
    });
    return dsi;
}
项目:syncope    文件:H2StartStopListener.java   
@Override
public void contextInitialized(final ServletContextEvent sce) {
    ServletContext context = sce.getServletContext();
    WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(context);

    try {
        Server h2TestDb = new Server();
        h2TestDb.runTool("-tcp", "-tcpDaemon", "-web", "-webDaemon",
                "-webPort", ctx.getBean("testdb.webport", String.class));

        context.setAttribute(H2_TESTDB, h2TestDb);
    } catch (SQLException e) {
        LOG.error("Could not start H2 test db", e);
    }

    DataSource datasource = ctx.getBean(DataSource.class);

    ResourceDatabasePopulator populator = new ResourceDatabasePopulator(ctx.getResource("classpath:/testdb.sql"));
    populator.setSqlScriptEncoding("UTF-8");
    DataSourceInitializer init = new DataSourceInitializer();
    init.setDataSource(datasource);
    init.setEnabled(true);
    init.setDatabasePopulator(populator);
    init.afterPropertiesSet();
    LOG.info("Database successfully initialized");
}
项目:spring-hadoop-getting-started    文件:Application.java   
@Bean
DataSourceInitializer hiveInitializer(final DataSource dataSource) {
    final String ddl = "create external table if not exists tweetdata (value STRING) LOCATION '" + input + "'";
    final DataSourceInitializer dsi = new DataSourceInitializer();
    dsi.setDataSource(dataSource);
    dsi.setDatabasePopulator(new DatabasePopulator() {
        @Override
        public void populate(Connection conn) throws SQLException,
                ScriptException {
            Statement st = conn.createStatement();
            st.execute(ddl);
            st.close();
        }
    });
    return dsi;
}
项目:mev    文件:PresetsRestConfigurationTest.java   
@Inject @Bean
public DataSourceInitializer dataSourceInitializer( @Named("presets-datasource") DataSource dataSource) {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);

    ResourceDatabasePopulator populator = new ResourceDatabasePopulator();

    String scriptDropAll = environment.getProperty("mev.presets.db.schema.script.dropall");
    log.info ("***dataSourceInitializer-dropAllPresetsScript-TEST:"+scriptDropAll);
    //populator.addScript(new ClassPathResource(scriptDropAll));
    String scriptTestPresetValuesFlatTable = environment.getProperty("mev.presets.db.schema.script.TestPresetValuesFlatTable");
    populator.addScript(new ClassPathResource(scriptTestPresetValuesFlatTable));

    initializer.setDatabasePopulator(populator);
     return initializer;
}
项目:mev    文件:ProbeAnnotationsPersistanceConfigTest.java   
@Inject @Bean
public DataSourceInitializer dataSourceInitializer( @Named("probe-annotations-datasource") DataSource dataSource) {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);

    ResourceDatabasePopulator populator = new ResourceDatabasePopulator();

    String scriptDropAll = environment.getProperty(MEV_PROBE_ANNOTATIONS_PROPERTY_PREFIX+"db.schema.script.dropall");
    log.info ("***dataSourceInitializer-dropAllScript-TEST:"+scriptDropAll);
    populator.addScript(new ClassPathResource(scriptDropAll));

    String scriptCreate = environment.getProperty(MEV_PROBE_ANNOTATIONS_PROPERTY_PREFIX+"db.schema.script");
    log.info ("***dataSourceInitializer-createScript-TEST:"+scriptCreate);
    populator.addScript(new ClassPathResource(scriptCreate));


    initializer.setDatabasePopulator(populator);
    return initializer;
}
项目:devops-cstack    文件:DatabaseConfiguration.java   
@Bean(name = "dataSourceInitializer")
public DataSourceInitializer dataSourceInitializer(
    final DataSource dataSource) {
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:devops-cstack    文件:DatabaseConfigurationTest.java   
@Bean
public DataSourceInitializer dataSourceInitializer(
        final DataSource dataSource) {
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:microservices-tcc-alfa    文件:AuthorizationServerConfiguration.java   
@Bean
public DataSourceInitializer dataSourceInitializer(DataSource dataSource) {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:Building-Web-Apps-with-Spring-5-and-Angular    文件:AppConfig.java   
@Bean
public DataSourceInitializer dataSourceInitializer(final DataSource dataSource) {
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:Building-Web-Apps-with-Spring-5-and-Angular    文件:AppConfig.java   
@Bean
public DataSourceInitializer dataSourceInitializer(final DataSource dataSource) {
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:lams    文件:InitializeDatabaseBeanDefinitionParser.java   
@Override
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
    BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(DataSourceInitializer.class);
    builder.addPropertyReference("dataSource", element.getAttribute("data-source"));
    builder.addPropertyValue("enabled", element.getAttribute("enabled"));
    DatabasePopulatorConfigUtils.setDatabasePopulator(element, builder);
    builder.getRawBeanDefinition().setSource(parserContext.extractSource(element));
    return builder.getBeanDefinition();
}
项目:spring-batch-admin    文件:DataSourceConfig.java   
@Bean
public DataSourceInitializer dataSourceInitializer(final DataSource dataSource) {
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setEnabled(Boolean.valueOf(env.getProperty("batch.data.source.init")));
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:spring4-understanding    文件:InitializeDatabaseBeanDefinitionParser.java   
@Override
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
    BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(DataSourceInitializer.class);
    builder.addPropertyReference("dataSource", element.getAttribute("data-source"));
    builder.addPropertyValue("enabled", element.getAttribute("enabled"));
    DatabasePopulatorConfigUtils.setDatabasePopulator(element, builder);
    builder.getRawBeanDefinition().setSource(parserContext.extractSource(element));
    return builder.getBeanDefinition();
}
项目:spring4-understanding    文件:JdbcNamespaceIntegrationTests.java   
@Test
public void createAndDestroy() throws Exception {
    ClassPathXmlApplicationContext context = context("jdbc-destroy-config.xml");
    try {
        DataSource dataSource = context.getBean(DataSource.class);
        JdbcTemplate template = new JdbcTemplate(dataSource);
        assertNumRowsInTestTable(template, 1);
        context.getBean(DataSourceInitializer.class).destroy();
        expected.expect(BadSqlGrammarException.class); // Table has been dropped
        assertNumRowsInTestTable(template, 1);
    }
    finally {
        context.close();
    }
}
项目:spring-boot    文件:OAuth2AuthorizationServerConfig.java   
@Bean
public DataSourceInitializer dataSourceInitializer(final DataSource dataSource) {
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:spring-boot-oauth2-server    文件:DataSourceConfig.java   
@Bean
public DataSourceInitializer dataSourceInitializer(DataSource dataSource) {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:spring-security-oauth    文件:OAuth2AuthorizationServerConfigInMemory.java   
@Bean
public DataSourceInitializer dataSourceInitializer(final DataSource dataSource) {
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:spring-security-oauth    文件:OAuth2AuthorizationServerConfig.java   
@Bean
public DataSourceInitializer dataSourceInitializer(final DataSource dataSource) {
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:flowable-engine    文件:DatabaseInititializer.java   
@Bean
public DataSourceInitializer dataSourceInitializer() {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:springJpaKata    文件:PopulatorConfig.java   
@Bean
@Primary
public DataSourceInitializer dataSourceInitializer(final DataSource dataSource) {
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:CCDA-Score-CARD    文件:PersistanceConfiguration.java   
@Autowired
@Bean
public DataSourceInitializer dataSourceInitializer(final DataSource dataSource) {
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:singular-server    文件:SingularDefaultPersistenceConfiguration.java   
@Bean
public DataSourceInitializer scriptsInitializer(final DataSource dataSource) {
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    initializer.setEnabled(isDatabaseInitializerEnabled());
    return initializer;
}
项目:singular-server    文件:SingularDefaultPersistenceConfiguration.java   
@Bean
@DependsOn("scriptsInitializer")
public DataSourceInitializer createFunctionInitializer(final DataSource dataSource) {
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    final ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
    populator.setSeparator("#");
    populator.setSqlScriptEncoding(StandardCharsets.UTF_8.name());
    populator.addScript(sqlCreateFunction);
    initializer.setDatabasePopulator(populator);
    initializer.setEnabled(isDatabaseInitializerEnabled());
    return initializer;
}
项目:spring-cloud-stream-app-starters    文件:JdbcSinkConfiguration.java   
@ConditionalOnProperty("jdbc.initialize")
@Bean
public DataSourceInitializer nonBootDataSourceInitializer(DataSource dataSource, ResourceLoader resourceLoader) {
    DataSourceInitializer dataSourceInitializer = new DataSourceInitializer();
    dataSourceInitializer.setDataSource(dataSource);
    ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
    databasePopulator.setIgnoreFailedDrops(true);
    dataSourceInitializer.setDatabasePopulator(databasePopulator);
    if ("true".equals(properties.getInitialize())) {
        databasePopulator.addScript(new DefaultInitializationScriptResource(properties));
    } else {
        databasePopulator.addScript(resourceLoader.getResource(properties.getInitialize()));
    }
    return dataSourceInitializer;
}
项目:springone-2015    文件:BatchHive2Configuration.java   
@Bean
public DataSourceInitializer exportDataSourceInitializer(@Qualifier("exportDataSource") DataSource exportDataSource) {
    ResourceDatabasePopulator resourceDatabasePopulator = new ResourceDatabasePopulator();
    resourceDatabasePopulator.addScript(new ClassPathResource("influencers-schema.sql"));
    DataSourceInitializer dataSourceInitializer = new DataSourceInitializer();
    dataSourceInitializer.setDataSource(exportDataSource);
    dataSourceInitializer.setDatabasePopulator(resourceDatabasePopulator);
    return dataSourceInitializer;
}
项目:spring-cloud-task    文件:TaskStartTests.java   
@Before
public void setup() {
    properties = new HashMap<>();
    properties.put("spring.datasource.url", DATASOURCE_URL);
    properties.put("spring.datasource.username", DATASOURCE_USER_NAME);
    properties.put("spring.datasource.password", DATASOURCE_USER_PASSWORD);
    properties.put("spring.datasource.driverClassName", DATASOURCE_DRIVER_CLASS_NAME);
    properties.put("spring.application.name",TASK_NAME);
    properties.put("spring.cloud.task.initialize.enable", "false");

    JdbcTemplate template = new JdbcTemplate(this.dataSource);
    template.execute("DROP TABLE IF EXISTS TASK_TASK_BATCH");
    template.execute("DROP TABLE IF EXISTS TASK_SEQ");
    template.execute("DROP TABLE IF EXISTS TASK_EXECUTION_PARAMS");
    template.execute("DROP TABLE IF EXISTS TASK_EXECUTION");
    template.execute("DROP TABLE IF EXISTS BATCH_STEP_EXECUTION_SEQ");
    template.execute("DROP TABLE IF EXISTS BATCH_STEP_EXECUTION_CONTEXT");
    template.execute("DROP TABLE IF EXISTS BATCH_STEP_EXECUTION");
    template.execute("DROP TABLE IF EXISTS BATCH_JOB_SEQ");
    template.execute("DROP TABLE IF EXISTS BATCH_JOB_EXECUTION_SEQ");
    template.execute("DROP TABLE IF EXISTS BATCH_JOB_EXECUTION_PARAMS");
    template.execute("DROP TABLE IF EXISTS BATCH_JOB_EXECUTION_CONTEXT");
    template.execute("DROP TABLE IF EXISTS BATCH_JOB_EXECUTION");
    template.execute("DROP TABLE IF EXISTS BATCH_JOB_INSTANCE");
    template.execute("DROP SEQUENCE IF EXISTS TASK_SEQ");

    DataSourceInitializer initializer = new DataSourceInitializer();

    initializer.setDataSource(dataSource);
    ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
    databasePopulator.addScript(new ClassPathResource("/org/springframework/cloud/task/schema-h2.sql"));
    initializer.setDatabasePopulator(databasePopulator);
    initializer.afterPropertiesSet();
}
项目:spring-cloud-task    文件:TaskLauncherSinkTests.java   
@Before
public void setup() {
    properties = new HashMap<>();
    properties.put("spring.datasource.url", DATASOURCE_URL);
    properties.put("spring.datasource.username", DATASOURCE_USER_NAME);
    properties.put("spring.datasource.password", DATASOURCE_USER_PASSWORD);
    properties.put("spring.datasource.driverClassName", DATASOURCE_DRIVER_CLASS_NAME);
    properties.put("spring.application.name",TASK_NAME);
    properties.put("spring.cloud.task.initialize.enable", "false");

    JdbcTemplate template = new JdbcTemplate(this.dataSource);
    template.execute("DROP TABLE IF EXISTS TASK_TASK_BATCH");
    template.execute("DROP TABLE IF EXISTS TASK_SEQ");
    template.execute("DROP TABLE IF EXISTS TASK_EXECUTION_PARAMS");
    template.execute("DROP TABLE IF EXISTS TASK_EXECUTION");
    template.execute("DROP TABLE IF EXISTS BATCH_STEP_EXECUTION_SEQ");
    template.execute("DROP TABLE IF EXISTS BATCH_STEP_EXECUTION_CONTEXT");
    template.execute("DROP TABLE IF EXISTS BATCH_STEP_EXECUTION");
    template.execute("DROP TABLE IF EXISTS BATCH_JOB_SEQ");
    template.execute("DROP TABLE IF EXISTS BATCH_JOB_EXECUTION_SEQ");
    template.execute("DROP TABLE IF EXISTS BATCH_JOB_EXECUTION_PARAMS");
    template.execute("DROP TABLE IF EXISTS BATCH_JOB_EXECUTION_CONTEXT");
    template.execute("DROP TABLE IF EXISTS BATCH_JOB_EXECUTION");
    template.execute("DROP TABLE IF EXISTS BATCH_JOB_INSTANCE");
    template.execute("DROP SEQUENCE IF EXISTS TASK_SEQ");


    DataSourceInitializer initializer = new DataSourceInitializer();

    initializer.setDataSource(dataSource);
    ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
    databasePopulator.addScript(new ClassPathResource("/org/springframework/cloud/task/schema-h2.sql"));
    initializer.setDatabasePopulator(databasePopulator);

    initializer.afterPropertiesSet();
}
项目:demo-break-association    文件:JdbcTestCases.java   
@Bean
public DataSourceInitializer dataSourceInitializer(final DataSource dataSource)
{
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    return initializer;
}
项目:class-guard    文件:InitializeDatabaseBeanDefinitionParser.java   
@Override
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
    BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(DataSourceInitializer.class);
    builder.addPropertyReference("dataSource", element.getAttribute("data-source"));
    builder.addPropertyValue("enabled", element.getAttribute("enabled"));
    DatabasePopulatorConfigUtils.setDatabasePopulator(element, builder);
    builder.getRawBeanDefinition().setSource(parserContext.extractSource(element));
    return builder.getBeanDefinition();
}
项目:spring-time    文件:DatabaseConfig.java   
@Inject
@Bean
public DataSourceInitializer dataSourceInitializer(final DataSource dataSource, List<DataLoader> loaders) {
    //in this example we don't have a classic script based populator
    final DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator());
    initializer.setDatabaseCleaner(databaseCleaner());
    //instead we use the dataloader
    loaders.stream().forEach((loader) -> {
        loader.load();
    });
    return initializer;
}
项目:mev    文件:TestPresetsDatasetFlatTableConfig.java   
@Inject @Bean
public DataSourceInitializer dataSourceInitializer( @Named("presets-datasource") DataSource dataSource) {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    ResourceDatabasePopulator populator = new ResourceDatabasePopulator();            
    initializer.setDatabasePopulator(populator);
    return initializer;
}
项目:mev    文件:TestJooqCursorLUSCLevel2Configuration.java   
@Inject @Bean
public DataSourceInitializer dataSourceInitializer( @Named("presets-datasource") DataSource dataSource) {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    ResourceDatabasePopulator populator = new ResourceDatabasePopulator();            
    initializer.setDatabasePopulator(populator);
    return initializer;
}
项目:mev    文件:TestJooqCursorGBMLevel2Configuration.java   
@Inject @Bean
public DataSourceInitializer dataSourceInitializer( @Named("presets-datasource") DataSource dataSource) {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    ResourceDatabasePopulator populator = new ResourceDatabasePopulator();            
    initializer.setDatabasePopulator(populator);
    return initializer;
}
项目:mev    文件:TestJooqCursorLGGLevel2Configuration.java   
@Inject @Bean
public DataSourceInitializer dataSourceInitializer( @Named("presets-datasource") DataSource dataSource) {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    ResourceDatabasePopulator populator = new ResourceDatabasePopulator();            
    initializer.setDatabasePopulator(populator);
    return initializer;
}
项目:mev    文件:TestPresetsDatasetNVPConfig.java   
@Inject @Bean
public DataSourceInitializer dataSourceInitializer( @Named("presets-datasource") DataSource dataSource) {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);

    ResourceDatabasePopulator populator = new ResourceDatabasePopulator();

    initializer.setDatabasePopulator(populator);
    return initializer;
}
项目:mev    文件:PresetRestPerfConfig.java   
@Inject @Bean
public DataSourceInitializer dataSourceInitializer( @Named("presets-datasource") DataSource dataSource) {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    ResourceDatabasePopulator populator = new ResourceDatabasePopulator();            
    initializer.setDatabasePopulator(populator);
    return initializer;
}
项目:mev    文件:TestJooqCursorLGGLevel2Configuration.java   
@Inject @Bean
public DataSourceInitializer dataSourceInitializer( @Named("presets-datasource") DataSource dataSource) {
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    ResourceDatabasePopulator populator = new ResourceDatabasePopulator();            
    initializer.setDatabasePopulator(populator);
    return initializer;
}