Package io.nflow.engine.config.db
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSQL variants optimized for H2. -
Field Summary
Fields inherited from class io.nflow.engine.config.db.DatabaseConfiguration
NFLOW_DATABASE_INITIALIZER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.h2.tools.ServerCreates a console server for connecting to the in-memory database.org.h2.tools.Serverh2TcpServer(Environment env) Creates a server for connecting to the in-memory database.sqlVariants(Environment env) Creates the SQL variants for the database.Methods inherited from class io.nflow.engine.config.db.DatabaseConfiguration
checkDatabaseConfiguration, getDbType, nflowDatabaseInitializer, nflowDatasource, nflowDatasource, nflowJdbcTemplate, nflowNamedParameterJdbcTemplate, nflowTransactionTemplate, property, property
-
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
Creates the SQL variants for the database.- Specified by:
sqlVariantsin classDatabaseConfiguration- Parameters:
env- The Spring environment.- Returns:
- SQL variants optimized for the database.
-