Package org.springframework.jdbc.datasource.init

Examples of org.springframework.jdbc.datasource.init.DataSourceInitializer.afterPropertiesSet()


    ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
    databasePopulator.addScript(new ClassPathResource("test-data.sql", this.getClass()));
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator);
    initializer.afterPropertiesSet();
  }

  private EntityManagerFactory getEntityManagerFactory(DataSource dataSource) throws Exception {
    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setDataSource(dataSource);
View Full Code Here


    ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
    databasePopulator.addScript(new ClassPathResource("test-data.sql", this.getClass()));
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator);
    initializer.afterPropertiesSet();
  }

  /* methods for subclasses */

  protected abstract void setUpResources(DataSource dataSource) throws Exception;
View Full Code Here

    ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
    databasePopulator.addScript(new ClassPathResource("test-data.sql", this.getClass()));
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(getDataSource());
    initializer.setDatabasePopulator(databasePopulator);
    initializer.afterPropertiesSet();
  }

}
View Full Code Here

    ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
    databasePopulator.addScript(new ClassPathResource("test-data.sql", this.getClass()));
    DataSourceInitializer initializer = new DataSourceInitializer();
    initializer.setDataSource(dataSource);
    initializer.setDatabasePopulator(databasePopulator);
    initializer.afterPropertiesSet();
  }

  private SessionFactory getSessionFactory(DataSource dataSource) throws Exception {
    LocalSessionFactoryBean factory = new LocalSessionFactoryBean();
    factory.setDataSource(dataSource);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.