Package liquibase.database.core
Class MockDatabase
java.lang.Object
liquibase.database.core.MockDatabase
- All Implemented Interfaces:
AutoCloseable,Database,InternalDatabase,PrioritizedService
A DBMS that effectively does nothing, but it is useful for tests where everything should work in the same way
for all databases.
-
Field Summary
Fields inherited from interface liquibase.database.Database
COMPLETE_SQL_SCOPE_KEY, databaseChangeLogLockTableName, databaseChangeLogTableName, IGNORE_MISSING_REFERENCES_KEYFields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanacquireLock(Liquibase liquibase) voidaddReservedWords(Collection<String> words) voidclose()voidcommit()convertRequestedSchemaToCatalog(String requestedSchema) convertRequestedSchemaToSchema(String requestedSchema) correctObjectName(String name, Class<? extends DatabaseObject> objectType) Fix the object name to the format the database expects, handling changes in case, etc.correctObjectName(String name, Class<? extends DatabaseObject> objectType, boolean quoteCorrectedName) correctSchema(CatalogAndSchema schema) Returns a new CatalogAndSchema adjusted for this database.booleanbooleandataTypeIsNotModifiable(String typeName) Types like int4 in postgres cannot have a modifier. e.g. int4(10) Checks whether the type is allowed to have a modifierbooleanbooleandoesTagExist(String tag) voiddropDatabaseObjects(CatalogAndSchema schema) Drops all objects in a specified schema.voidbooleanequals(DatabaseObject otherObject, Database accordingTo) escapeColumnName(String catalogName, String schemaName, String tableName, String columnName) Escapes a single column name in a database-dependent manner so reserved words can be used as a column name (i.e.escapeColumnName(String catalogName, String schemaName, String tableName, String columnName, boolean quoteNamesThatMayBeFunctions) Similar toDatabase.escapeColumnName(String, String, String, String)but allows control over whether function-like names should be left unquoted.escapeColumnNameList(String columnNames) Escapes a list of column names in a database-dependent manner so reserved words can be used as a column name (i.e.escapeConstraintName(String constraintName) escapeDataTypeName(String dataTypeName) escapeIndexName(String catalogName, String schemaName, String indexName) escapeObjectName(String objectName, Class<? extends DatabaseObject> objectType) escapeObjectName(String catalogName, String schemaName, String objectName, Class<? extends DatabaseObject> objectType) escapeSequenceName(String catalogName, String schemaName, String sequenceName) escapeStringForDatabase(String string) escapeTableName(String catalogName, String schemaName, String tableName) escapeViewName(String catalogName, String schemaName, String viewName) voidexecute(SqlStatement[] statements, List<SqlVisitor> sqlVisitors) voidexecuteRollbackStatements(Change change, List<SqlVisitor> sqlVisitors) voidexecuteRollbackStatements(SqlStatement[] statements, List<SqlVisitor> sqlVisitors) voidexecuteStatements(Change change, DatabaseChangeLog changeLog, List<SqlVisitor> sqlVisitors) generateDatabaseFunctionValue(DatabaseFunction databaseFunction) Some function names are placeholders that need to be replaced with the specific database value.generatePrimaryKeyName(String tableName) booleanAuto-commit mode to run ingetAutoIncrementClause(BigInteger startWith, BigInteger incrementBy, String generationType, Boolean defaultOnNull) Returns database-specific auto-increment DDL clause.getConcatSql(String... values) Returns SQL to concat the passed values.Returns database-specific function for generating the current date/time.intintReturns the name of the database product according to the underlying database.intgetDataTypeMaxParameters(String dataTypeName) Returns list of database native date functionsgetDateLiteral(String isoDate) getDateLiteral(Date date) getDateLiteral(Date defaultDateValue) getDateTimeLiteral(Timestamp timeStamp) getDefaultDriver(String url) If this database understands the given url, return the default driver class name.intWhen a TIMESTAMP column without the parameter "number of fractional digits" is created, what is the default value?getDefaultScaleForNativeDataType(String nativeDataType) Returns the default precision for a given native data type, e.g.getJdbcCatalogName(CatalogAndSchema schema) getJdbcCatalogName(Schema schema) getJdbcSchemaName(CatalogAndSchema schema) getJdbcSchemaName(Schema schema) intDetermines the maximum precision (number of fractional digits) for TIMESTAMP columns for the given database.getName()booleanbooleanShould the schema be included in identifiers even if it is the default schema?intgetRanChangeSet(ChangeSet changeSet) Returns the ChangeSets that have been run against the current database.getRanDate(ChangeSet changeSet) getRunStatus(ChangeSet changeSet) Returns the run status for the given ChangeSetgetSchemaFromJdbcInfo(String rawCatalogName, String rawSchemaName) Returns an all-lower-case short name of the product.getTimeLiteral(Time time) getViewDefinition(CatalogAndSchema schema, String name) booleanbooleanbooleanIs this AbstractDatabase subclass the correct one to use for the given connection.booleanisDefaultCatalog(String catalog) If the database supports catalogs, test if a given catalog name equals to the default catalog of the current logged in user.booleanisDefaultSchema(String catalog, String schema) If the database supports schemas, test if a given combination of catalog and schema name equals to the default catalog and schema of the current logged in user.booleanisFunction(String string) booleanisLiquibaseObject(DatabaseObject object) booleanisReservedWord(String string) booleanbooleanisSystemObject(DatabaseObject example) voidmarkChangeSetExecStatus(ChangeSet changeSet, ChangeSet.ExecType execType) After the changeset has been run against the database this method will update the change log table with the information.voidvoidremoveRanStatus(ChangeSet changeSet) booleanDoes the database require explicit NULL for nullable columns?booleanbooleanvoidvoidrollback()voidsaveRollbackStatement(Change change, List<SqlVisitor> sqlVisitors, Writer writer) voidsaveStatements(Change change, List<SqlVisitor> sqlVisitors, Writer writer) voidsetAutoCommit(boolean b) voidsetCanCacheLiquibaseTableInfo(boolean canCacheLiquibaseTableInfo) voidsetCaseSensitive(boolean caseSensitive) voidsetConnection(Connection conn) voidvoidsetCurrentDateTimeFunction(String function) voidsetDatabaseChangeLogLockTableName(String tableName) Does nothingvoidsetDatabaseChangeLogTableName(String tableName) Does nothingvoidsetDefaultCatalogName(String catalogName) voidsetDefaultSchemaName(String schemaName) voidsetLiquibaseCatalogName(String catalogName) voidsetLiquibaseSchemaName(String schemaName) voidsetLiquibaseTablespaceName(String tablespaceName) voidsetObjectQuotingStrategy(ObjectQuotingStrategy quotingStrategy) voidsetOutputDefaultCatalog(boolean outputDefaultCatalog) voidsetOutputDefaultSchema(boolean outputDefaultSchema) Whether the default schema should be included in generated SQLvoidsetSupportsCatalogs(boolean supportsCatalogs) voidsetSupportsSchemas(boolean supportsSchemas) voidsetSupportsSequences(boolean supportsSequences) booleansupports(Class<? extends DatabaseObject> object) Whether this database supports the specified object type.booleanbooleanDoes the database support batched DML (INSERT/UPDATE/DELETE/MERGE/...) statements sent in a single call to the database?booleanbooleansupportsCatalogInObjectName(Class<? extends DatabaseObject> type) booleanWhether this database supports catalogsbooleansupportsCreateIfNotExists(Class<? extends DatabaseObject> type) Does the database support the "if not exits" syntax?booleanDetermines if the database supports DDL within a transaction or not.booleanbooleanbooleanReturns whether this database support initially deferrable columns.booleanDoes this database treat NOT NULL as an own kind of CONSTRAINT (in addition of simply being a column property)?booleanbooleanbooleanWhether this database supports schemasbooleanWhether this database supports sequencesbooleanvoidTags the database changelog with the given string.toString()unescapeDataTypeName(String dataTypeName) unescapeDataTypeString(String dataTypeString) voidupdateChecksum(ChangeSet changeSet) validate()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface liquibase.database.Database
addCompleteSqlToScope, afterUpdate, checkDatabaseConnection, dropDatabaseObjects, escapeForLike, failOnDefferable, generateConnectCommandSuccessMessage, getDisplayName, supportsDatabaseChangeLogHistory, temporarilySetObjectQuotingStrategy
-
Constructor Details
-
MockDatabase
public MockDatabase()
-
-
Method Details
-
getDefaultScaleForNativeDataType
Description copied from interface:DatabaseReturns the default precision for a given native data type, e.g. "datetime2" for Microsoft SQL Server.- Specified by:
getDefaultScaleForNativeDataTypein interfaceDatabase- Parameters:
nativeDataType- the name of the native data type (case-insensitive).- Returns:
- The default precision of the native data type, or null if the type is unknown to this database.
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfacePrioritizedService
-
getSchema
-
getName
-
getDefaultSchema
- Specified by:
getDefaultSchemain interfaceDatabase
-
getDefaultPort
- Specified by:
getDefaultPortin interfaceDatabase
-
getContainingObjects
-
equals
-
setCanCacheLiquibaseTableInfo
public void setCanCacheLiquibaseTableInfo(boolean canCacheLiquibaseTableInfo) - Specified by:
setCanCacheLiquibaseTableInfoin interfaceDatabase
-
requiresUsername
public boolean requiresUsername()- Specified by:
requiresUsernamein interfaceDatabase
-
requiresPassword
public boolean requiresPassword()- Specified by:
requiresPasswordin interfaceDatabase
-
isCorrectDatabaseImplementation
Description copied from interface:DatabaseIs this AbstractDatabase subclass the correct one to use for the given connection.- Specified by:
isCorrectDatabaseImplementationin interfaceDatabase
-
getDefaultDriver
Description copied from interface:DatabaseIf this database understands the given url, return the default driver class name. Otherwise return null.- Specified by:
getDefaultDriverin interfaceDatabase
-
getConnection
- Specified by:
getConnectionin interfaceDatabase
-
setConnection
- Specified by:
setConnectionin interfaceDatabase
-
setConnection
-
getAutoCommitMode
public boolean getAutoCommitMode()Description copied from interface:DatabaseAuto-commit mode to run in- Specified by:
getAutoCommitModein interfaceDatabase
-
isAutoCommit
public boolean isAutoCommit()- Specified by:
isAutoCommitin interfaceDatabase
-
setAutoCommit
public void setAutoCommit(boolean b) - Specified by:
setAutoCommitin interfaceDatabase
-
isCaseSensitive
public boolean isCaseSensitive()- Specified by:
isCaseSensitivein interfaceDatabase
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive) -
supportsDDLInTransaction
public boolean supportsDDLInTransaction()Description copied from interface:DatabaseDetermines if the database supports DDL within a transaction or not.- Specified by:
supportsDDLInTransactionin interfaceDatabase- Returns:
- True if the database supports DDL within a transaction, otherwise false.
-
getDatabaseProductName
Description copied from interface:DatabaseReturns the name of the database product according to the underlying database.- Specified by:
getDatabaseProductNamein interfaceDatabase
-
getDatabaseProductVersion
- Specified by:
getDatabaseProductVersionin interfaceDatabase
-
getDatabaseMajorVersion
public int getDatabaseMajorVersion()- Specified by:
getDatabaseMajorVersionin interfaceDatabase
-
getDatabaseMinorVersion
public int getDatabaseMinorVersion()- Specified by:
getDatabaseMinorVersionin interfaceDatabase
-
getShortName
Description copied from interface:DatabaseReturns an all-lower-case short name of the product. Used for end-user selecting of database type such as the DBMS precondition.- Specified by:
getShortNamein interfaceDatabase
-
getDriverName
-
getConnectionURL
-
getConnectionUsername
-
getDefaultCatalogName
- Specified by:
getDefaultCatalogNamein interfaceDatabase
-
setDefaultCatalogName
- Specified by:
setDefaultCatalogNamein interfaceDatabase
-
getDefaultSchemaName
- Specified by:
getDefaultSchemaNamein interfaceDatabase
-
setDefaultSchemaName
- Specified by:
setDefaultSchemaNamein interfaceDatabase
-
supportsInitiallyDeferrableColumns
public boolean supportsInitiallyDeferrableColumns()Description copied from interface:DatabaseReturns whether this database support initially deferrable columns.- Specified by:
supportsInitiallyDeferrableColumnsin interfaceDatabase
-
supportsSequences
public boolean supportsSequences()Description copied from interface:DatabaseWhether this database supports sequences- Specified by:
supportsSequencesin interfaceDatabase
-
setSupportsSequences
public void setSupportsSequences(boolean supportsSequences) -
supportsDropTableCascadeConstraints
public boolean supportsDropTableCascadeConstraints()- Specified by:
supportsDropTableCascadeConstraintsin interfaceDatabase
-
supportsAutoIncrement
public boolean supportsAutoIncrement()- Specified by:
supportsAutoIncrementin interfaceDatabase
-
getDateLiteral
- Specified by:
getDateLiteralin interfaceDatabase
-
getDateLiteral
- Specified by:
getDateLiteralin interfaceDatabase
-
getTimeLiteral
- Specified by:
getTimeLiteralin interfaceDatabase
-
getDateTimeLiteral
- Specified by:
getDateTimeLiteralin interfaceDatabase
-
getCurrentDateTimeFunction
Description copied from interface:DatabaseReturns database-specific function for generating the current date/time.- Specified by:
getCurrentDateTimeFunctionin interfaceDatabase
-
setCurrentDateTimeFunction
- Specified by:
setCurrentDateTimeFunctionin interfaceDatabase
-
getLineComment
- Specified by:
getLineCommentin interfaceDatabase
-
getAutoIncrementClause
public String getAutoIncrementClause(BigInteger startWith, BigInteger incrementBy, String generationType, Boolean defaultOnNull) Description copied from interface:DatabaseReturns database-specific auto-increment DDL clause.- Specified by:
getAutoIncrementClausein interfaceDatabase
-
getCommitSQL
-
getDatabaseChangeLogTableName
- Specified by:
getDatabaseChangeLogTableNamein interfaceDatabase- See Also:
-
setDatabaseChangeLogTableName
Does nothing- Specified by:
setDatabaseChangeLogTableNamein interfaceDatabase- Parameters:
tableName- the name of the change log table to set- See Also:
-
getDatabaseChangeLogLockTableName
- Specified by:
getDatabaseChangeLogLockTableNamein interfaceDatabase- See Also:
-
setDatabaseChangeLogLockTableName
Does nothing- Specified by:
setDatabaseChangeLogLockTableNamein interfaceDatabase- See Also:
-
getConcatSql
Description copied from interface:DatabaseReturns SQL to concat the passed values.- Specified by:
getConcatSqlin interfaceDatabase
-
acquireLock
-
releaseLock
public void releaseLock() -
listLocks
-
dropDatabaseObjects
Description copied from interface:DatabaseDrops all objects in a specified schema.- Specified by:
dropDatabaseObjectsin interfaceDatabase- Parameters:
schema- schema (catalog+)schema to drop
-
tag
Description copied from interface:DatabaseTags the database changelog with the given string. -
doesTagExist
- Specified by:
doesTagExistin interfaceDatabase
-
isSystemObject
- Specified by:
isSystemObjectin interfaceDatabase
-
isLiquibaseObject
- Specified by:
isLiquibaseObjectin interfaceDatabase
-
supportsTablespaces
public boolean supportsTablespaces()- Specified by:
supportsTablespacesin interfaceDatabase
-
getViewDefinition
- Specified by:
getViewDefinitionin interfaceDatabase
-
getDatabaseProductName
-
getDateLiteral
- Specified by:
getDateLiteralin interfaceDatabase
-
escapeTableName
- Specified by:
escapeTableNamein interfaceDatabase
-
escapeIndexName
- Specified by:
escapeIndexNamein interfaceDatabase
-
escapeColumnName
public String escapeColumnName(String catalogName, String schemaName, String tableName, String columnName) Description copied from interface:DatabaseEscapes a single column name in a database-dependent manner so reserved words can be used as a column name (i.e. "return").- Specified by:
escapeColumnNamein interfaceDatabasecolumnName- column name- Returns:
- escaped column name
-
escapeColumnName
public String escapeColumnName(String catalogName, String schemaName, String tableName, String columnName, boolean quoteNamesThatMayBeFunctions) Description copied from interface:DatabaseSimilar toDatabase.escapeColumnName(String, String, String, String)but allows control over whether function-like names should be left unquoted.- Specified by:
escapeColumnNamein interfaceDatabase
-
escapeColumnNameList
Description copied from interface:DatabaseEscapes a list of column names in a database-dependent manner so reserved words can be used as a column name (i.e. "return").- Specified by:
escapeColumnNameListin interfaceDatabase- Parameters:
columnNames- list of column names- Returns:
- escaped column name list
-
escapeSequenceName
- Specified by:
escapeSequenceNamein interfaceDatabase
-
convertRequestedSchemaToSchema
-
convertRequestedSchemaToCatalog
-
supports
Description copied from interface:DatabaseWhether this database supports the specified object type. It is invoking the deprecated methods to ensure that extensions are not broken, but once those are removed it will return only true -
supportsSchemas
public boolean supportsSchemas()Description copied from interface:DatabaseWhether this database supports schemas- Specified by:
supportsSchemasin interfaceDatabase
-
setSupportsSchemas
public void setSupportsSchemas(boolean supportsSchemas) -
supportsCatalogs
public boolean supportsCatalogs()Description copied from interface:DatabaseWhether this database supports catalogs- Specified by:
supportsCatalogsin interfaceDatabase
-
getSchemaAndCatalogCase
- Specified by:
getSchemaAndCatalogCasein interfaceDatabase
-
setSupportsCatalogs
public void setSupportsCatalogs(boolean supportsCatalogs) -
supportsCatalogInObjectName
public boolean supportsCatalogInObjectName() -
generatePrimaryKeyName
- Specified by:
generatePrimaryKeyNamein interfaceDatabase
-
escapeViewName
- Specified by:
escapeViewNamein interfaceDatabase
-
acquireLock
public boolean acquireLock() -
getRunStatus
public ChangeSet.RunStatus getRunStatus(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException Description copied from interface:DatabaseReturns the run status for the given ChangeSet- Specified by:
getRunStatusin interfaceDatabase- Throws:
DatabaseExceptionDatabaseHistoryException
-
getRanChangeSet
public RanChangeSet getRanChangeSet(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException - Specified by:
getRanChangeSetin interfaceDatabase- Throws:
DatabaseExceptionDatabaseHistoryException
-
markChangeSetExecStatus
public void markChangeSetExecStatus(ChangeSet changeSet, ChangeSet.ExecType execType) throws DatabaseException Description copied from interface:DatabaseAfter the changeset has been run against the database this method will update the change log table with the information.- Specified by:
markChangeSetExecStatusin interfaceDatabase- Throws:
DatabaseException
-
getRanChangeSetList
Description copied from interface:DatabaseReturns the ChangeSets that have been run against the current database.- Specified by:
getRanChangeSetListin interfaceDatabase- Throws:
DatabaseException
-
getRanDate
- Specified by:
getRanDatein interfaceDatabase- Throws:
DatabaseExceptionDatabaseHistoryException
-
removeRanStatus
- Specified by:
removeRanStatusin interfaceDatabase- Throws:
DatabaseException
-
commit
public void commit() -
rollback
public void rollback() -
getSelectChangeLogLockSQL
-
escapeStringForDatabase
- Specified by:
escapeStringForDatabasein interfaceDatabase
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceDatabase
-
supportsRestrictForeignKeys
public boolean supportsRestrictForeignKeys()- Specified by:
supportsRestrictForeignKeysin interfaceDatabase
-
escapeConstraintName
- Specified by:
escapeConstraintNamein interfaceDatabase
-
isSafeToRunUpdate
public boolean isSafeToRunUpdate()- Specified by:
isSafeToRunUpdatein interfaceDatabase
-
escapeObjectName
- Specified by:
escapeObjectNamein interfaceDatabase
-
escapeObjectName
public String escapeObjectName(String catalogName, String schemaName, String objectName, Class<? extends DatabaseObject> objectType) - Specified by:
escapeObjectNamein interfaceDatabase
-
executeStatements
public void executeStatements(Change change, DatabaseChangeLog changeLog, List<SqlVisitor> sqlVisitors) - Specified by:
executeStatementsin interfaceDatabase
-
execute
-
saveStatements
- Specified by:
saveStatementsin interfaceDatabase
-
executeRollbackStatements
- Specified by:
executeRollbackStatementsin interfaceDatabase
-
executeRollbackStatements
- Specified by:
executeRollbackStatementsin interfaceDatabase
-
saveRollbackStatement
- Specified by:
saveRollbackStatementin interfaceDatabase
-
getLiquibaseCatalogName
- Specified by:
getLiquibaseCatalogNamein interfaceDatabase
-
setLiquibaseCatalogName
- Specified by:
setLiquibaseCatalogNamein interfaceDatabase
-
getLiquibaseSchemaName
- Specified by:
getLiquibaseSchemaNamein interfaceDatabase
-
setLiquibaseSchemaName
- Specified by:
setLiquibaseSchemaNamein interfaceDatabase
-
getLiquibaseTablespaceName
- Specified by:
getLiquibaseTablespaceNamein interfaceDatabase
-
setLiquibaseTablespaceName
- Specified by:
setLiquibaseTablespaceNamein interfaceDatabase
-
parseDate
-
getDateFunctions
Description copied from interface:DatabaseReturns list of database native date functions- Specified by:
getDateFunctionsin interfaceDatabase
-
resetInternalState
public void resetInternalState()- Specified by:
resetInternalStatein interfaceDatabase
-
supportsForeignKeyDisable
public boolean supportsForeignKeyDisable()- Specified by:
supportsForeignKeyDisablein interfaceDatabase
-
disableForeignKeyChecks
public boolean disableForeignKeyChecks()- Specified by:
disableForeignKeyChecksin interfaceDatabase
-
enableForeignKeyChecks
public void enableForeignKeyChecks()- Specified by:
enableForeignKeyChecksin interfaceDatabase
-
updateChecksum
-
isReservedWord
- Specified by:
isReservedWordin interfaceDatabase
-
correctSchema
Description copied from interface:DatabaseReturns a new CatalogAndSchema adjusted for this database. Examples of adjustments include: fixes for case issues, replacing null schema or catalog names with the default values removing set schema or catalog names if they are not supported- Specified by:
correctSchemain interfaceDatabase
-
correctObjectName
Description copied from interface:DatabaseFix the object name to the format the database expects, handling changes in case, etc.- Specified by:
correctObjectNamein interfaceDatabase
-
correctObjectName
public String correctObjectName(String name, Class<? extends DatabaseObject> objectType, boolean quoteCorrectedName) -
getFetchSize
- Specified by:
getFetchSizein interfaceDatabase
-
isFunction
- Specified by:
isFunctionin interfaceDatabase
-
getDataTypeMaxParameters
- Specified by:
getDataTypeMaxParametersin interfaceDatabase
-
getSchemaFromJdbcInfo
-
getJdbcCatalogName
-
getJdbcSchemaName
-
getJdbcCatalogName
-
getJdbcSchemaName
-
dataTypeIsNotModifiable
Description copied from interface:DatabaseTypes like int4 in postgres cannot have a modifier. e.g. int4(10) Checks whether the type is allowed to have a modifier- Specified by:
dataTypeIsNotModifiablein interfaceDatabase- Parameters:
typeName- type name- Returns:
- Whether data type can have a modifier
-
generateDatabaseFunctionValue
Description copied from interface:DatabaseSome function names are placeholders that need to be replaced with the specific database value. e.g. nextSequenceValue(sequenceName) should be replaced with NEXT_VAL('sequenceName') for Postgresql- Specified by:
generateDatabaseFunctionValuein interfaceDatabase- Parameters:
databaseFunction- database function to check.- Returns:
- the string value to use for an update or generate
-
getObjectQuotingStrategy
- Specified by:
getObjectQuotingStrategyin interfaceDatabase
-
setObjectQuotingStrategy
- Specified by:
setObjectQuotingStrategyin interfaceDatabase
-
supportsCatalogInObjectName
- Specified by:
supportsCatalogInObjectNamein interfaceDatabase
-
createsIndexesForForeignKeys
public boolean createsIndexesForForeignKeys()- Specified by:
createsIndexesForForeignKeysin interfaceDatabase
-
getOutputDefaultSchema
public boolean getOutputDefaultSchema()Description copied from interface:DatabaseShould the schema be included in identifiers even if it is the default schema?- Specified by:
getOutputDefaultSchemain interfaceDatabase- Returns:
- true (if the schema should be included in every case) or false (omit if default schema)
-
setOutputDefaultSchema
public void setOutputDefaultSchema(boolean outputDefaultSchema) Description copied from interface:DatabaseWhether the default schema should be included in generated SQL- Specified by:
setOutputDefaultSchemain interfaceDatabase
-
getOutputDefaultCatalog
public boolean getOutputDefaultCatalog()- Specified by:
getOutputDefaultCatalogin interfaceDatabase
-
setOutputDefaultCatalog
public void setOutputDefaultCatalog(boolean outputDefaultCatalog) - Specified by:
setOutputDefaultCatalogin interfaceDatabase
-
isDefaultSchema
Description copied from interface:DatabaseIf the database supports schemas, test if a given combination of catalog and schema name equals to the default catalog and schema of the current logged in user.- Specified by:
isDefaultSchemain interfaceDatabase- Parameters:
catalog- catalog name to be testedschema- schema name to be tested- Returns:
- if the database supports catalogs: true if it is the default schema, false if not. If it does not support schemas, the behaviour of this method is undefined (please call supportsSchemas first!)
-
isDefaultCatalog
Description copied from interface:DatabaseIf the database supports catalogs, test if a given catalog name equals to the default catalog of the current logged in user.- Specified by:
isDefaultCatalogin interfaceDatabase- Parameters:
catalog- catalog name to be tested- Returns:
- if the database supports catalogs: true if it is the default catalog, false if not. If it does not support catalogs, the behaviour of this method is undefined (please call supportsCatalog first!)
-
supportsPrimaryKeyNames
public boolean supportsPrimaryKeyNames()- Specified by:
supportsPrimaryKeyNamesin interfaceDatabase
-
getSystemSchema
- Specified by:
getSystemSchemain interfaceDatabase
-
addReservedWords
- Specified by:
addReservedWordsin interfaceDatabase
-
toString
-
escapeDataTypeName
- Specified by:
escapeDataTypeNamein interfaceDatabase
-
unescapeDataTypeName
- Specified by:
unescapeDataTypeNamein interfaceDatabase
-
unescapeDataTypeString
- Specified by:
unescapeDataTypeStringin interfaceDatabase
-
validate
-
supportsNotNullConstraintNames
public boolean supportsNotNullConstraintNames()Description copied from interface:DatabaseDoes this database treat NOT NULL as an own kind of CONSTRAINT (in addition of simply being a column property)? This will affect the CONSTRAINT clause SQL generators.- Specified by:
supportsNotNullConstraintNamesin interfaceDatabase- Returns:
- true if the database supports naming NOT NULL constraints, false if not.
-
supportsBatchUpdates
public boolean supportsBatchUpdates()Description copied from interface:DatabaseDoes the database support batched DML (INSERT/UPDATE/DELETE/MERGE/...) statements sent in a single call to the database?- Specified by:
supportsBatchUpdatesin interfaceDatabase- Returns:
- true if the database has this capability for all DML statements, false in all other cases
-
getMaxFractionalDigitsForTimestamp
public int getMaxFractionalDigitsForTimestamp()Description copied from interface:DatabaseDetermines the maximum precision (number of fractional digits) for TIMESTAMP columns for the given database. Might not always be able to give an exact answer since, for some DBMS, it depends on the actual software version if fractional digits are supported. A warning should be logged in this case.- Specified by:
getMaxFractionalDigitsForTimestampin interfaceDatabase- Returns:
- the number of allowed fractional digits for TIMESTAMP columns. May return 0.
-
getDefaultFractionalDigitsForTimestamp
public int getDefaultFractionalDigitsForTimestamp()Description copied from interface:DatabaseWhen a TIMESTAMP column without the parameter "number of fractional digits" is created, what is the default value?- Specified by:
getDefaultFractionalDigitsForTimestampin interfaceDatabase- Returns:
- The default number of fractional digits for TIMESTAMP columns
-
requiresExplicitNullForColumns
public boolean requiresExplicitNullForColumns()Description copied from interface:DatabaseDoes the database require explicit NULL for nullable columns?- Specified by:
requiresExplicitNullForColumnsin interfaceDatabase- Returns:
- true if the database behaves incorrectly if NULL is not explicitly specified, false if it behaves like any good RDBMS should.
-
supportsCreateIfNotExists
Description copied from interface:DatabaseDoes the database support the "if not exits" syntax?- Specified by:
supportsCreateIfNotExistsin interfaceDatabase- Parameters:
type- the DatabaseObject type to be checked.- Returns:
- true if the "if not exists" syntax is supported, false otherwise.
-