public abstract class AbstractScriptDatabaseInitializer extends Object implements ResourceLoaderAware, InitializingBean
InitializingBean
that performs SQL database initialization
using schema (DDL) and data (DML) scripts.Modifier | Constructor and Description |
---|---|
protected |
AbstractScriptDatabaseInitializer(DatabaseInitializationSettings settings)
Creates a new
AbstractScriptDatabaseInitializer that will initialize the
database using the given settings. |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
boolean |
initializeDatabase()
Initializes the database by applying schema and data scripts.
|
protected abstract void |
runScripts(List<Resource> resources,
boolean continueOnError,
String separator,
Charset encoding) |
void |
setResourceLoader(ResourceLoader resourceLoader) |
protected AbstractScriptDatabaseInitializer(DatabaseInitializationSettings settings)
AbstractScriptDatabaseInitializer
that will initialize the
database using the given settings.settings
- initialization settingspublic void setResourceLoader(ResourceLoader resourceLoader)
setResourceLoader
in interface ResourceLoaderAware
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public boolean initializeDatabase()
true
if one or more scripts were applied to the database, otherwise
false