Annotation Type EmbeddedDatabaseConfiguration
-
@Target(TYPE) @Retention(RUNTIME) @Documented @Inherited public @interface EmbeddedDatabaseConfiguration
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
continueOnError
Specify that all failures which occur while executing SQL scripts should be logged but should not cause a failure, defaults tofalse
.String
databaseName
Set the name of the embedded database.org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
databaseType
Set the type of embedded database.boolean
defaultScripts
Add default SQL scripts to execute to populate the database.boolean
generateUniqueName
Specify whether a unique identifier should be generated and used as the database name.boolean
ignoreFailedDrops
Specify that a failed SQLDROP
statement within an executed scripts can be ignored.String[]
scripts
Add SQL scripts to execute to initialize or populate the database.
-
-
-
Element Detail
-
generateUniqueName
boolean generateUniqueName
Specify 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 databaseName
Set 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 databaseType
Set the type of embedded database. Use the same defaults as spring:EmbeddedDatabaseType.HSQL
.- Returns:
- The
EmbeddedDatabaseType
to use. - See Also:
EmbeddedDatabaseBuilder.setType(EmbeddedDatabaseType)
- Default:
- org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType.HSQL
-
-
-
scripts
String[] scripts
Add 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 continueOnError
Specify 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 ignoreFailedDrops
Specify 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
-
-