Annotation Type EmbeddedDatabaseConfiguration
@Target(TYPE)
@Retention(RUNTIME)
@Documented
@Inherited
public @interface EmbeddedDatabaseConfiguration
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanSpecify that all failures which occur while executing SQL scripts should be logged but should not cause a failure, defaults tofalse.Set the name of the embedded database.org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseTypeSet the type of embedded database.booleanAdd default SQL scripts to execute to populate the database.booleanSpecify whether a unique identifier should be generated and used as the database name.booleanSpecify that a failed SQLDROPstatement within an executed scripts can be ignored.String[]Add SQL scripts to execute to initialize or populate the database.
-
Element Details
-
generateUniqueName
boolean generateUniqueNameSpecify whether a unique identifier should be generated and used as the database name.- Returns:
trueto automatically generate a unique database name,falseotherwise.- See Also:
-
EmbeddedDatabaseBuilder.generateUniqueName(boolean)
- Default:
- false
-
databaseName
String databaseNameSet the name of the embedded database. Defaults to springEmbeddedDatabaseFactory.DEFAULT_DATABASE_NAME.- Returns:
- The database name.
- See Also:
-
EmbeddedDatabaseBuilder.setName(String)
- Default:
- "testdb"
-
databaseType
org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType databaseTypeSet the type of embedded database. Use the same defaults as spring:EmbeddedDatabaseType.HSQL.- Returns:
- The
EmbeddedDatabaseTypeto use. - See Also:
-
EmbeddedDatabaseBuilder.setType(EmbeddedDatabaseType)
- Default:
- HSQL
-
defaultScripts
boolean defaultScriptsAdd default SQL scripts to execute to populate the database.- Returns:
- Add default SQL script (managed by
EmbeddedDatabase). - See Also:
-
EmbeddedDatabaseBuilder.addDefaultScripts()
- Default:
- false
-
scripts
String[] scriptsAdd SQL scripts to execute to initialize or populate the database.- Returns:
- All the SQL scripts to execute.
- See Also:
-
EmbeddedDatabaseBuilder.addScript(String)EmbeddedDatabaseBuilder.addScripts(String...)
- Default:
- {}
-
continueOnError
boolean continueOnErrorSpecify that all failures which occur while executing SQL scripts should be logged but should not cause a failure, defaults tofalse.- Returns:
trueto continue in case of errors,falseotherwise.- See Also:
-
EmbeddedDatabaseBuilder.continueOnError(boolean)
- Default:
- false
-
ignoreFailedDrops
boolean ignoreFailedDropsSpecify that a failed SQLDROPstatement within an executed scripts can be ignored. This is useful for a database whose SQL dialect does not support anIF EXISTSclause in aDROPstatement. The default isfalse- Returns:
trueif errors inDROPstatement should be ignored,falseotherwise.- See Also:
-
EmbeddedDatabaseBuilder.ignoreFailedDrops(boolean)
- Default:
- false
-