Class BaseDatabaseType
- java.lang.Object
-
- migratedb.v1.core.internal.database.base.BaseDatabaseType
-
- All Implemented Interfaces:
DatabaseType
- Direct Known Subclasses:
BigQueryDatabaseType,CockroachDBDatabaseType,DB2DatabaseType,DerbyDatabaseType,FirebirdDatabaseType,H2DatabaseType,HSQLDBDatabaseType,IgniteThinDatabaseType,InformixDatabaseType,MariaDBDatabaseType,MySQLDatabaseType,OracleDatabaseType,PostgreSQLDatabaseType,RedshiftDatabaseType,SAPHANADatabaseType,SnowflakeDatabaseType,SpannerDatabaseType,SQLiteDatabaseType,SQLServerDatabaseType,SybaseASEJConnectDatabaseType,SybaseASEJTDSDatabaseType
public abstract class BaseDatabaseType extends Object implements DatabaseType
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PRIORITY
-
Constructor Summary
Constructors Constructor Description BaseDatabaseType()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidalterConnectionAsNeeded(Connection connection, Configuration configuration)Carries out any manipulation on the Connection that is required by MigrateDB's configDatabasecreateDatabase(Configuration configuration, boolean printInfo, JdbcConnectionFactory jdbcConnectionFactory)Initializes the Database class, and optionally prints some information.abstract DatabasecreateDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory)Initializes the Database used by this Database Type.DatabaseExecutionStrategycreateExecutionStrategy(Connection connection)Initializes the DatabaseExecutionStrategy used by this Database Type.abstract BaseParsercreateParser(Configuration configuration, ResourceProvider resourceProvider, ParsingContext parsingContext)Initializes the Parser used by this Database Type.SqlScriptExecutorFactorycreateSqlScriptExecutorFactory(JdbcConnectionFactory jdbcConnectionFactory, CallbackExecutor callbackExecutor)Initializes the SqlScriptExecutorFactory used by this Database Type.SqlScriptFactorycreateSqlScriptFactory(Configuration configuration, ParsingContext parsingContext)Initializes the SqlScriptFactory used by this Database Type.ExecutionTemplatecreateTransactionalExecutionTemplate(Connection connection, boolean rollbackOnException)Initializes the ExecutionTemplate used by this Database Type.abstract StringgetName()abstract intgetNullType()intgetPriority()When identifying database types, the priority with which this type will be used.static StringgetSelectVersionOutput(Connection connection)Retrieves the version string for a connection as described by SELECT VERSION(), which may differ from the connection metadata.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface migratedb.v1.core.api.internal.database.base.DatabaseType
handlesDatabaseProductNameAndVersion
-
-
-
-
Field Detail
-
DEFAULT_PRIORITY
public static final int DEFAULT_PRIORITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public abstract String getName()
- Specified by:
getNamein interfaceDatabaseType- Returns:
- The human-readable name for this database.
-
getNullType
public abstract int getNullType()
- Specified by:
getNullTypein interfaceDatabaseType- Returns:
- The JDBC type used to represent
nullin prepared statements.
-
getPriority
public int getPriority()
When identifying database types, the priority with which this type will be used. High numbers indicate that this type will be used in preference to others.- Specified by:
getPriorityin interfaceDatabaseType
-
createDatabase
public Database createDatabase(Configuration configuration, boolean printInfo, JdbcConnectionFactory jdbcConnectionFactory)
Description copied from interface:DatabaseTypeInitializes the Database class, and optionally prints some information.- Specified by:
createDatabasein interfaceDatabaseType- Parameters:
configuration- The MigrateDB configuration.printInfo- Where the DB info should be printed in the logs.jdbcConnectionFactory- The current connection factory.- Returns:
- The appropriate Database class.
-
createDatabase
public abstract Database createDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory)
Description copied from interface:DatabaseTypeInitializes the Database used by this Database Type.- Specified by:
createDatabasein interfaceDatabaseType- Parameters:
configuration- The MigrateDB configuration.jdbcConnectionFactory- The current connection factory.- Returns:
- The Database.
-
createParser
public abstract BaseParser createParser(Configuration configuration, ResourceProvider resourceProvider, ParsingContext parsingContext)
Description copied from interface:DatabaseTypeInitializes the Parser used by this Database Type.- Specified by:
createParserin interfaceDatabaseType- Parameters:
configuration- The MigrateDB configuration.- Returns:
- The Parser.
-
createSqlScriptFactory
public SqlScriptFactory createSqlScriptFactory(Configuration configuration, ParsingContext parsingContext)
Description copied from interface:DatabaseTypeInitializes the SqlScriptFactory used by this Database Type.- Specified by:
createSqlScriptFactoryin interfaceDatabaseType- Parameters:
configuration- The MigrateDB configuration.- Returns:
- The SqlScriptFactory.
-
createSqlScriptExecutorFactory
public SqlScriptExecutorFactory createSqlScriptExecutorFactory(JdbcConnectionFactory jdbcConnectionFactory, CallbackExecutor callbackExecutor)
Description copied from interface:DatabaseTypeInitializes the SqlScriptExecutorFactory used by this Database Type.- Specified by:
createSqlScriptExecutorFactoryin interfaceDatabaseType- Parameters:
jdbcConnectionFactory- The current connection factory.- Returns:
- The SqlScriptExecutorFactory.
-
createExecutionStrategy
public DatabaseExecutionStrategy createExecutionStrategy(Connection connection)
Description copied from interface:DatabaseTypeInitializes the DatabaseExecutionStrategy used by this Database Type.- Specified by:
createExecutionStrategyin interfaceDatabaseType- Returns:
- The DatabaseExecutionStrategy.
-
createTransactionalExecutionTemplate
public ExecutionTemplate createTransactionalExecutionTemplate(Connection connection, boolean rollbackOnException)
Description copied from interface:DatabaseTypeInitializes the ExecutionTemplate used by this Database Type.- Specified by:
createTransactionalExecutionTemplatein interfaceDatabaseType- Returns:
- The ExecutionTemplate.
-
getSelectVersionOutput
public static String getSelectVersionOutput(Connection connection)
Retrieves the version string for a connection as described by SELECT VERSION(), which may differ from the connection metadata.
-
alterConnectionAsNeeded
public void alterConnectionAsNeeded(Connection connection, Configuration configuration)
Description copied from interface:DatabaseTypeCarries out any manipulation on the Connection that is required by MigrateDB's config- Specified by:
alterConnectionAsNeededin interfaceDatabaseType- Parameters:
connection- The JDBC connection.configuration- The MigrateDB configuration.
-
-