Java Code Examples for org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder#addScript()

The following examples show how to use org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder#addScript() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RepositoryTestConfig.java    From Project with Apache License 2.0 5 votes vote down vote up
@Bean
public DataSource dataSource() {
  EmbeddedDatabaseBuilder edb = new EmbeddedDatabaseBuilder();
  edb.setType(EmbeddedDatabaseType.H2);
  edb.addScript("spittr/db/hibernate4/schema.sql");
  edb.addScript("spittr/db/hibernate4/test-data.sql");
  EmbeddedDatabase embeddedDatabase = edb.build();
  return embeddedDatabase;
}
 
Example 2
Source File: JpaConfig.java    From Project with Apache License 2.0 5 votes vote down vote up
@Bean
public DataSource dataSource() {
  EmbeddedDatabaseBuilder edb = new EmbeddedDatabaseBuilder();
  edb.setType(EmbeddedDatabaseType.H2);
  edb.addScript("spittr/db/jpa/schema.sql");
  edb.addScript("spittr/db/jpa/test-data.sql");
  EmbeddedDatabase embeddedDatabase = edb.build();
  return embeddedDatabase;
}
 
Example 3
Source File: JpaConfig.java    From Project with Apache License 2.0 5 votes vote down vote up
@Bean
public DataSource dataSource() {
  EmbeddedDatabaseBuilder edb = new EmbeddedDatabaseBuilder();
  edb.setType(EmbeddedDatabaseType.H2);
  edb.addScript("spittr/db/jpa/schema.sql");
  edb.addScript("spittr/db/jpa/test-data.sql");
  EmbeddedDatabase embeddedDatabase = edb.build();
  return embeddedDatabase;
}
 
Example 4
Source File: DataConfig.java    From Project with Apache License 2.0 5 votes vote down vote up
@Bean
public DataSource dataSource() {
  EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
  builder.setType(EmbeddedDatabaseType.H2);
  builder.addScript("classpath:spittr/db/jdbc/schema.sql");
  builder.addScript("classpath:spittr/db/jdbc/test-data.sql");
  return builder.build();
}
 
Example 5
Source File: InfrastructureConfig.java    From Learning-Path-Spring-5-End-to-End-Programming with MIT License 5 votes vote down vote up
@Bean
public DataSource dataSource(){
	EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2);//in-memory
	builder.addScript("schema.sql");
	builder.addScript("data.sql");
	return builder.build();
}
 
Example 6
Source File: InfrastructureConfig.java    From Learning-Path-Spring-5-End-to-End-Programming with MIT License 5 votes vote down vote up
@Bean
public DataSource dataSource(){
	EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2);//in-memory
	builder.addScript("schema.sql");
	builder.addScript("data.sql");
	return builder.build();
}
 
Example 7
Source File: InfrastructureConfig.java    From Learning-Path-Spring-5-End-to-End-Programming with MIT License 5 votes vote down vote up
@Bean
public DataSource dataSource(){
	EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2);//in-memory
	builder.addScript("schema.sql");
	builder.addScript("data.sql");
	return builder.build();
}