Annotation Type EmbeddedDatabaseConfiguration


@Target(TYPE) @Retention(RUNTIME) @Documented @Inherited public @interface EmbeddedDatabaseConfiguration
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Specify that all failures which occur while executing SQL scripts should be logged but should not cause a failure, defaults to false.
    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 SQL DROP statement within an executed scripts can be ignored.
    Add SQL scripts to execute to initialize or populate the database.
  • Element Details

    • 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 spring EmbeddedDatabaseFactory.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:
      HSQL
    • defaultScripts

      boolean defaultScripts
      Add 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[] 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 to false.
      Returns:
      true to continue in case of errors, false otherwise.
      See Also:
      • EmbeddedDatabaseBuilder.continueOnError(boolean)
      Default:
      false
    • ignoreFailedDrops

      boolean ignoreFailedDrops
      Specify that a failed SQL DROP statement within an executed scripts can be ignored. This is useful for a database whose SQL dialect does not support an IF EXISTS clause in a DROP statement. The default is false
      Returns:
      true if errors in DROP statement should be ignored, false otherwise.
      See Also:
      • EmbeddedDatabaseBuilder.ignoreFailedDrops(boolean)
      Default:
      false