Annotation Type EmbeddedDatabaseConfiguration
@Target(TYPE)
@Retention(RUNTIME)
@Documented
@Inherited
public @interface EmbeddedDatabaseConfiguration
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
Specify 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.EmbeddedDatabaseType
Set the type of embedded database.boolean
Add default SQL scripts to execute to populate the database.boolean
Specify whether a unique identifier should be generated and used as the database name.boolean
Specify that a failed SQLDROP
statement 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:
true
to automatically generate a unique database name,false
otherwise.- 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
EmbeddedDatabaseType
to 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:
true
to continue in case of errors,false
otherwise.- See Also:
-
EmbeddedDatabaseBuilder.continueOnError(boolean)
- Default:
false
-
ignoreFailedDrops
boolean ignoreFailedDropsSpecify that a failed SQLDROP
statement within an executed scripts can be ignored. This is useful for a database whose SQL dialect does not support anIF EXISTS
clause in aDROP
statement. The default isfalse
- Returns:
true
if errors inDROP
statement should be ignored,false
otherwise.- See Also:
-
EmbeddedDatabaseBuilder.ignoreFailedDrops(boolean)
- Default:
false
-