Class DatabaseInitializationSettings
java.lang.Object
org.springframework.boot.sql.init.DatabaseInitializationSettings
Settings for initializing an SQL database.
- Since:
- 2.5.0
- Author:
- Andy Wilkinson
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns the locations of data (DML) scripts to apply to the database.Returns the encoding to use when reading the schema and data scripts.getMode()Gets the mode to use when determining whether database initialization should be performed.Returns the locations of the schema (DDL) scripts to apply to the database.Returns the statement separator used in the schema and data scripts.booleanReturns whether to continue when an error occurs while applying a schema or data script.voidsetContinueOnError(boolean continueOnError) Sets whether initialization should continue when an error occurs when applying a schema or data script.voidsetDataLocations(List<String> dataLocations) Sets the locations of data (DML) scripts to apply to the database.voidsetEncoding(Charset encoding) Sets the encoding to use when reading the schema and data scripts.voidSets the mode the use when determining whether database initialization should be performed.voidsetSchemaLocations(List<String> schemaLocations) Sets the locations of schema (DDL) scripts to apply to the database.voidsetSeparator(String separator) Sets the statement separator to use when reading the schema and data scripts.
- 
Constructor Details- 
DatabaseInitializationSettingspublic DatabaseInitializationSettings()
 
- 
- 
Method Details- 
getSchemaLocationsReturns the locations of the schema (DDL) scripts to apply to the database.- Returns:
- the locations of the schema scripts
 
- 
setSchemaLocationsSets the locations of schema (DDL) scripts to apply to the database. By default, initialization will fail if a location does not exist. To prevent a failure, a location can be made optional by prefixing it withoptional:.- Parameters:
- schemaLocations- locations of the schema scripts
 
- 
getDataLocationsReturns the locations of data (DML) scripts to apply to the database.- Returns:
- the locations of the data scripts
 
- 
setDataLocationsSets the locations of data (DML) scripts to apply to the database. By default, initialization will fail if a location does not exist. To prevent a failure, a location can be made optional by prefixing it withoptional:.- Parameters:
- dataLocations- locations of the data scripts
 
- 
isContinueOnErrorpublic boolean isContinueOnError()Returns whether to continue when an error occurs while applying a schema or data script.- Returns:
- whether to continue on error
 
- 
setContinueOnErrorpublic void setContinueOnError(boolean continueOnError) Sets whether initialization should continue when an error occurs when applying a schema or data script.- Parameters:
- continueOnError- whether to continue when an error occurs.
 
- 
getSeparatorReturns the statement separator used in the schema and data scripts.- Returns:
- the statement separator
 
- 
setSeparatorSets the statement separator to use when reading the schema and data scripts.- Parameters:
- separator- statement separator used in the schema and data scripts
 
- 
getEncodingReturns the encoding to use when reading the schema and data scripts.- Returns:
- the script encoding
 
- 
setEncodingSets the encoding to use when reading the schema and data scripts.- Parameters:
- encoding- encoding to use when reading the schema and data scripts
 
- 
getModeGets the mode to use when determining whether database initialization should be performed.- Returns:
- the initialization mode
- Since:
- 2.5.1
 
- 
setModeSets the mode the use when determining whether database initialization should be performed.- Parameters:
- mode- the initialization mode
- Since:
- 2.5.1
 
 
-