| java.lang.Object | |
| ↳ | org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder |
A builder that provides a fluent API for constructing an embedded database.
Usage example:
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
EmbeddedDatabase db = builder.setType(H2).addScript("schema.sql").addScript("data.sql").build();
db.shutdown();
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Create a new embedded database builder.
| |||||||||||
Create a new embedded database builder with the given ResourceLoader.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Add default scripts to execute to populate the database.
| |||||||||||
Adds a SQL script to execute to populate the database.
| |||||||||||
Build the embedded database.
| |||||||||||
Sets the name of the embedded database
Defaults to 'testdb' if not called.
| |||||||||||
Sets the type of embedded database.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Create a new embedded database builder.
Create a new embedded database builder with the given ResourceLoader.
| resourceLoader | the ResourceLoader to delegate to |
|---|
Add default scripts to execute to populate the database.
The default scripts are schema.sql to create the db schema and data.sql to populate the db with data.
Adds a SQL script to execute to populate the database.
| sqlResource | the sql resource location |
|---|
Sets the name of the embedded database Defaults to 'testdb' if not called.
| databaseName | the database name |
|---|
Sets the type of embedded database. Defaults to HSQL if not called.
| databaseType | the database type |
|---|