public class DataSourceScriptDatabaseInitializer extends AbstractScriptDatabaseInitializer
InitializingBean
that performs DataSource
initialization using schema
(DDL) and data (DML) scripts.Constructor and Description |
---|
DataSourceScriptDatabaseInitializer(DataSource dataSource,
DatabaseInitializationSettings settings)
Creates a new
DataSourceScriptDatabaseInitializer that will initialize the
given DataSource using the given settings. |
Modifier and Type | Method and Description |
---|---|
protected DataSource |
getDataSource()
Returns the
DataSource that will be initialized. |
protected boolean |
isEmbeddedDatabase()
Returns whether the database that is to be initialized is embedded.
|
protected void |
runScripts(List<Resource> resources,
boolean continueOnError,
String separator,
Charset encoding) |
afterPropertiesSet, initializeDatabase, setResourceLoader
public DataSourceScriptDatabaseInitializer(DataSource dataSource, DatabaseInitializationSettings settings)
DataSourceScriptDatabaseInitializer
that will initialize the
given DataSource
using the given settings.dataSource
- data source to initializesettings
- the initialization settingsprotected final DataSource getDataSource()
DataSource
that will be initialized.protected boolean isEmbeddedDatabase()
AbstractScriptDatabaseInitializer
isEmbeddedDatabase
in class AbstractScriptDatabaseInitializer
true
if the database is embedded, otherwise false
protected void runScripts(List<Resource> resources, boolean continueOnError, String separator, Charset encoding)
runScripts
in class AbstractScriptDatabaseInitializer