public class DataSourceScriptDatabaseInitializer extends AbstractScriptDatabaseInitializer
InitializingBean
that performs DataSource
initialization using schema
(DDL) and data (DML) scripts.Constructor and Description |
---|
DataSourceScriptDatabaseInitializer(javax.sql.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 javax.sql.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(java.util.List<org.springframework.core.io.Resource> resources,
boolean continueOnError,
java.lang.String separator,
java.nio.charset.Charset encoding) |
afterPropertiesSet, initializeDatabase, setResourceLoader
public DataSourceScriptDatabaseInitializer(javax.sql.DataSource dataSource, DatabaseInitializationSettings settings)
DataSourceScriptDatabaseInitializer
that will initialize the
given DataSource
using the given settings.dataSource
- data source to initializesettings
- the initialization settingsprotected final javax.sql.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(java.util.List<org.springframework.core.io.Resource> resources, boolean continueOnError, java.lang.String separator, java.nio.charset.Charset encoding)
runScripts
in class AbstractScriptDatabaseInitializer