Class H2Database
- java.lang.Object
-
- migratedb.core.internal.database.base.BaseDatabase<H2Connection>
-
- migratedb.core.internal.database.h2.H2Database
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Database<H2Connection>
public class H2Database extends BaseDatabase<H2Connection>
-
-
Field Summary
-
Fields inherited from class migratedb.core.internal.database.base.BaseDatabase
configuration, databaseType, jdbcConnectionFactory, jdbcMetaData, jdbcTemplate, rawMainJdbcConnection
-
-
Constructor Summary
Constructors Constructor Description H2Database(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancatalogIsSchema()protected VersiondetermineVersion()protected H2ConnectiondoGetConnection(Connection connection)Retrieves a MigrateDB Connection for this JDBC connection.protected StringdoGetCurrentUser()voidensureSupported()Ensure MigrateDB supports this version of this database.StringgetBooleanFalse()StringgetBooleanTrue()StringgetRawCreateScript(Table<?,?> table, boolean baseline)StringgetSelectStatement(Table<?,?> table)booleansupportsChangingCurrentSchema()booleansupportsDdlTransactions()-
Methods inherited from class migratedb.core.internal.database.base.BaseDatabase
cleanPostSchemas, cleanPreSchemas, close, computeVersionDisplayName, doCleanPostSchemas, doCleanPreSchemas, doGetCatalog, doQuote, ensureDatabaseIsRecentEnough, getAllSchemas, getBaselineStatement, getCatalog, getCloseQuote, getCreateScript, getCurrentUser, getDatabaseType, getDefaultDelimiter, getEscapedQuote, getInsertStatement, getInstalledBy, getJdbcMetaData, getMainConnection, getMigrationConnection, getOpenQuote, getVersion, quote, recommendMigrateDbUpgradeIfNecessary, recommendMigrateDbUpgradeIfNecessaryForMajorVersion, supportsEmptyMigrationDescription, supportsMultiStatementTransactions, unQuote, useSingleConnection
-
-
-
-
Constructor Detail
-
H2Database
public H2Database(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory)
-
-
Method Detail
-
doGetConnection
protected H2Connection doGetConnection(Connection connection)
Description copied from class:BaseDatabaseRetrieves a MigrateDB Connection for this JDBC connection.- Specified by:
doGetConnectionin classBaseDatabase<H2Connection>
-
determineVersion
protected Version determineVersion()
- Overrides:
determineVersionin classBaseDatabase<H2Connection>- Returns:
- The major and minor version of the database.
-
ensureSupported
public final void ensureSupported()
Description copied from interface:DatabaseEnsure MigrateDB supports this version of this database.
-
getSelectStatement
public String getSelectStatement(Table<?,?> table)
- Specified by:
getSelectStatementin interfaceDatabase<H2Connection>- Overrides:
getSelectStatementin classBaseDatabase<H2Connection>
-
doGetCurrentUser
protected String doGetCurrentUser() throws SQLException
- Overrides:
doGetCurrentUserin classBaseDatabase<H2Connection>- Throws:
SQLException
-
supportsDdlTransactions
public boolean supportsDdlTransactions()
-
supportsChangingCurrentSchema
public boolean supportsChangingCurrentSchema()
-
getBooleanTrue
public String getBooleanTrue()
- Returns:
- The representation of the value
truein a boolean column.
-
getBooleanFalse
public String getBooleanFalse()
- Returns:
- The representation of the value
falsein a boolean column.
-
catalogIsSchema
public boolean catalogIsSchema()
- Returns:
trueif this database uses a catalog to represent a schema, orfalseif a schema is simply a schema.
-
-