Class H2DatabaseConfiguration

java.lang.Object
io.nflow.engine.config.db.DatabaseConfiguration
io.nflow.engine.config.db.H2DatabaseConfiguration

@Profile("nflow.db.h2") @Configuration public class H2DatabaseConfiguration extends DatabaseConfiguration
Configuration for H2 database.
  • Constructor Details

    • H2DatabaseConfiguration

      public H2DatabaseConfiguration()
      Create a new instance.
  • Method Details

    • h2TcpServer

      @Bean(initMethod="start", destroyMethod="stop") public org.h2.tools.Server h2TcpServer(Environment env) throws SQLException
      Creates a server for connecting to the in-memory database.
      Parameters:
      env - The Spring environemnt for getting the configuration properties.
      Returns:
      A TCP server.
      Throws:
      SQLException - If H2 server could not start
    • h2ConsoleServer

      @Bean(initMethod="start", destroyMethod="stop") public org.h2.tools.Server h2ConsoleServer(Environment env) throws SQLException
      Creates a console server for connecting to the in-memory database.
      Parameters:
      env - The Spring environemnt for getting the configuration properties.
      Returns:
      A TCP server.
      Throws:
      SQLException - If H2 server could not start
    • sqlVariants

      @Bean public SQLVariants sqlVariants(Environment env)
      Creates the SQL variants for the database.
      Specified by:
      sqlVariants in class DatabaseConfiguration
      Parameters:
      env - The Spring environment.
      Returns:
      SQL variants optimized for the database.