public class MockDatabase extends Object implements Database, InternalDatabase
databaseChangeLogLockTableName, databaseChangeLogTableNameCOMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT| Constructor and Description |
|---|
MockDatabase() |
public int getPriority()
getPriority in interface PrioritizedServicepublic Schema getSchema()
public String getName()
public CatalogAndSchema getDefaultSchema()
getDefaultSchema in interface Databasepublic Integer getDefaultPort()
getDefaultPort in interface Databasepublic DatabaseObject[] getContainingObjects()
public boolean equals(DatabaseObject otherObject, Database accordingTo)
public void setCanCacheLiquibaseTableInfo(boolean canCacheLiquibaseTableInfo)
setCanCacheLiquibaseTableInfo in interface Databasepublic boolean requiresUsername()
requiresUsername in interface Databasepublic boolean requiresPassword()
requiresPassword in interface Databasepublic boolean isCorrectDatabaseImplementation(DatabaseConnection conn) throws DatabaseException
DatabaseisCorrectDatabaseImplementation in interface DatabaseDatabaseExceptionpublic String getDefaultDriver(String url)
DatabasegetDefaultDriver in interface Databasepublic DatabaseConnection getConnection()
getConnection in interface Databasepublic void setConnection(Connection conn)
public void setConnection(DatabaseConnection conn)
setConnection in interface Databasepublic boolean getAutoCommitMode()
DatabasegetAutoCommitMode in interface Databasepublic boolean isAutoCommit()
throws DatabaseException
isAutoCommit in interface DatabaseDatabaseExceptionpublic boolean isCaseSensitive()
isCaseSensitive in interface Databasepublic void setCaseSensitive(boolean caseSensitive)
public void setAutoCommit(boolean b)
throws DatabaseException
setAutoCommit in interface DatabaseDatabaseExceptionpublic boolean supportsDDLInTransaction()
DatabasesupportsDDLInTransaction in interface Databasepublic String getDatabaseProductName()
getDatabaseProductName in interface Databasepublic String getDatabaseProductVersion() throws DatabaseException
getDatabaseProductVersion in interface DatabaseDatabaseExceptionpublic int getDatabaseMajorVersion()
throws DatabaseException
getDatabaseMajorVersion in interface DatabaseDatabaseExceptionpublic int getDatabaseMinorVersion()
throws DatabaseException
getDatabaseMinorVersion in interface DatabaseDatabaseExceptionpublic String getShortName()
DatabasegetShortName in interface Databasepublic String getDriverName() throws DatabaseException
DatabaseExceptionpublic String getConnectionURL() throws DatabaseException
DatabaseExceptionpublic String getConnectionUsername() throws DatabaseException
DatabaseExceptionpublic String getDefaultCatalogName()
getDefaultCatalogName in interface Databasepublic void setDefaultCatalogName(String catalogName) throws DatabaseException
setDefaultCatalogName in interface DatabaseDatabaseExceptionpublic String getDefaultSchemaName()
getDefaultSchemaName in interface Databasepublic void setDefaultSchemaName(String schemaName) throws DatabaseException
setDefaultSchemaName in interface DatabaseDatabaseExceptionpublic boolean supportsInitiallyDeferrableColumns()
DatabasesupportsInitiallyDeferrableColumns in interface Databasepublic boolean supportsSequences()
supportsSequences in interface Databasepublic void setSupportsSequences(boolean supportsSequences)
public boolean supportsDropTableCascadeConstraints()
supportsDropTableCascadeConstraints in interface Databasepublic boolean supportsAutoIncrement()
supportsAutoIncrement in interface Databasepublic String getDateLiteral(String isoDate)
getDateLiteral in interface Databasepublic String getDateLiteral(Date date)
getDateLiteral in interface Databasepublic String getTimeLiteral(Time time)
getTimeLiteral in interface Databasepublic String getDateTimeLiteral(Timestamp timeStamp)
getDateTimeLiteral in interface Databasepublic String getCurrentDateTimeFunction()
DatabasegetCurrentDateTimeFunction in interface Databasepublic void setCurrentDateTimeFunction(String function)
setCurrentDateTimeFunction in interface Databasepublic String getLineComment()
getLineComment in interface Databasepublic String getAutoIncrementClause(BigInteger startWith, BigInteger incrementBy)
getAutoIncrementClause in interface Databasepublic SqlStatement getCommitSQL()
public String getDatabaseChangeLogTableName()
getDatabaseChangeLogTableName in interface DatabaseDatabase.getDatabaseChangeLogTableName()public String getDatabaseChangeLogLockTableName()
getDatabaseChangeLogLockTableName in interface DatabaseDatabase.getDatabaseChangeLogLockTableName()public void setDatabaseChangeLogLockTableName(String tableName)
setDatabaseChangeLogLockTableName in interface DatabaseDatabase.setDatabaseChangeLogLockTableName(java.lang.String)public void setDatabaseChangeLogTableName(String tableName)
setDatabaseChangeLogTableName in interface DatabaseDatabase.setDatabaseChangeLogTableName(java.lang.String)public String getConcatSql(String... values)
DatabasegetConcatSql in interface Databasepublic boolean acquireLock(Liquibase liquibase) throws LockException
LockExceptionpublic void releaseLock()
throws LockException
LockExceptionpublic DatabaseChangeLogLock[] listLocks() throws LockException
LockExceptionpublic void dropDatabaseObjects(CatalogAndSchema schema) throws DatabaseException
dropDatabaseObjects in interface DatabaseDatabaseExceptionpublic void tag(String tagString) throws DatabaseException
tag in interface DatabaseDatabaseExceptionpublic boolean doesTagExist(String tag) throws DatabaseException
doesTagExist in interface DatabaseDatabaseExceptionpublic boolean isSystemObject(DatabaseObject example)
isSystemObject in interface Databasepublic boolean isLiquibaseObject(DatabaseObject object)
isLiquibaseObject in interface Databasepublic boolean supportsTablespaces()
supportsTablespaces in interface Databasepublic String getViewDefinition(CatalogAndSchema schema, String name) throws DatabaseException
getViewDefinition in interface DatabaseDatabaseExceptionpublic String getDatabaseProductName(DatabaseConnection conn) throws DatabaseException
DatabaseExceptionpublic String getDateLiteral(Date defaultDateValue)
getDateLiteral in interface Databasepublic String escapeTableName(String catalogName, String schemaName, String tableName)
escapeTableName in interface Databasepublic String escapeIndexName(String catalogName, String schemaName, String indexName)
escapeIndexName in interface Databasepublic String escapeColumnName(String catalogName, String schemaName, String tableName, String columnName)
DatabaseescapeColumnName in interface DatabasecolumnName - column namepublic String escapeColumnName(String catalogName, String schemaName, String tableName, String columnName, boolean quoteNamesThatMayBeFunctions)
escapeColumnName in interface Databasepublic String escapeColumnNameList(String columnNames)
DatabaseescapeColumnNameList in interface DatabasecolumnNames - list of column namespublic String escapeSequenceName(String catalogName, String schemaName, String sequenceName)
escapeSequenceName in interface Databasepublic String convertRequestedSchemaToSchema(String requestedSchema) throws DatabaseException
DatabaseExceptionpublic String convertRequestedSchemaToCatalog(String requestedSchema) throws DatabaseException
DatabaseExceptionpublic boolean supportsSchemas()
supportsSchemas in interface Databasepublic void setSupportsSchemas(boolean supportsSchemas)
public boolean supportsCatalogs()
supportsCatalogs in interface Databasepublic void setSupportsCatalogs(boolean supportsCatalogs)
public boolean supportsCatalogInObjectName()
public String generatePrimaryKeyName(String tableName)
generatePrimaryKeyName in interface Databasepublic String escapeViewName(String catalogName, String schemaName, String viewName)
escapeViewName in interface Databasepublic boolean acquireLock()
throws LockException
LockExceptionpublic ChangeSet.RunStatus getRunStatus(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
getRunStatus in interface DatabaseDatabaseExceptionDatabaseHistoryExceptionpublic RanChangeSet getRanChangeSet(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
getRanChangeSet in interface DatabaseDatabaseExceptionDatabaseHistoryExceptionpublic void markChangeSetExecStatus(ChangeSet changeSet, ChangeSet.ExecType execType) throws DatabaseException
markChangeSetExecStatus in interface DatabaseDatabaseExceptionpublic List<RanChangeSet> getRanChangeSetList() throws DatabaseException
getRanChangeSetList in interface DatabaseDatabaseExceptionpublic Date getRanDate(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
getRanDate in interface DatabaseDatabaseExceptionDatabaseHistoryExceptionpublic void removeRanStatus(ChangeSet changeSet) throws DatabaseException
removeRanStatus in interface DatabaseDatabaseExceptionpublic SqlStatement getSelectChangeLogLockSQL() throws DatabaseException
DatabaseExceptionpublic String escapeStringForDatabase(String string)
escapeStringForDatabase in interface Databasepublic void close()
throws DatabaseException
close in interface DatabaseDatabaseExceptionpublic boolean supportsRestrictForeignKeys()
supportsRestrictForeignKeys in interface Databasepublic String escapeConstraintName(String constraintName)
escapeConstraintName in interface Databasepublic boolean isSafeToRunUpdate()
throws DatabaseException
isSafeToRunUpdate in interface DatabaseDatabaseExceptionpublic String escapeObjectName(String objectName, Class<? extends DatabaseObject> objectType)
escapeObjectName in interface Databasepublic String escapeObjectName(String catalogName, String schemaName, String objectName, Class<? extends DatabaseObject> objectType)
escapeObjectName in interface Databasepublic void executeStatements(Change change, DatabaseChangeLog changeLog, List<SqlVisitor> sqlVisitors) throws LiquibaseException
executeStatements in interface DatabaseLiquibaseExceptionpublic void execute(SqlStatement[] statements, List<SqlVisitor> sqlVisitors) throws LiquibaseException
execute in interface DatabaseLiquibaseExceptionpublic void saveStatements(Change change, List<SqlVisitor> sqlVisitors, Writer writer) throws IOException, StatementNotSupportedOnDatabaseException, LiquibaseException
saveStatements in interface DatabaseIOExceptionStatementNotSupportedOnDatabaseExceptionLiquibaseExceptionpublic void executeRollbackStatements(Change change, List<SqlVisitor> sqlVisitors) throws LiquibaseException, RollbackImpossibleException
executeRollbackStatements in interface DatabaseLiquibaseExceptionRollbackImpossibleExceptionpublic void executeRollbackStatements(SqlStatement[] statements, List<SqlVisitor> sqlVisitors) throws LiquibaseException, RollbackImpossibleException
executeRollbackStatements in interface DatabaseLiquibaseExceptionRollbackImpossibleExceptionpublic void saveRollbackStatement(Change change, List<SqlVisitor> sqlVisitors, Writer writer) throws IOException, RollbackImpossibleException, StatementNotSupportedOnDatabaseException, LiquibaseException
saveRollbackStatement in interface DatabaseIOExceptionRollbackImpossibleExceptionStatementNotSupportedOnDatabaseExceptionLiquibaseExceptionpublic String getLiquibaseCatalogName()
getLiquibaseCatalogName in interface Databasepublic void setLiquibaseCatalogName(String catalogName)
setLiquibaseCatalogName in interface Databasepublic String getLiquibaseSchemaName()
getLiquibaseSchemaName in interface Databasepublic void setLiquibaseSchemaName(String schemaName)
setLiquibaseSchemaName in interface Databasepublic String getLiquibaseTablespaceName()
getLiquibaseTablespaceName in interface Databasepublic void setLiquibaseTablespaceName(String tablespaceName)
setLiquibaseTablespaceName in interface Databasepublic Date parseDate(String dateAsString) throws DateParseException
parseDate in interface DatabaseDateParseExceptionpublic List<DatabaseFunction> getDateFunctions()
DatabasegetDateFunctions in interface Databasepublic void resetInternalState()
resetInternalState in interface Databasepublic boolean supportsForeignKeyDisable()
supportsForeignKeyDisable in interface Databasepublic boolean disableForeignKeyChecks()
throws DatabaseException
disableForeignKeyChecks in interface DatabaseDatabaseExceptionpublic void enableForeignKeyChecks()
throws DatabaseException
enableForeignKeyChecks in interface DatabaseDatabaseExceptionpublic void updateChecksum(ChangeSet changeSet) throws DatabaseException
DatabaseExceptionpublic boolean isReservedWord(String string)
isReservedWord in interface Databasepublic CatalogAndSchema correctSchema(CatalogAndSchema schema)
DatabasecorrectSchema in interface Databasepublic String correctObjectName(String name, Class<? extends DatabaseObject> objectType)
DatabasecorrectObjectName in interface Databasepublic String correctObjectName(String name, Class<? extends DatabaseObject> objectType, boolean quoteCorrectedName)
public Integer getFetchSize()
getFetchSize in interface Databasepublic boolean isFunction(String string)
isFunction in interface Databasepublic int getDataTypeMaxParameters(String dataTypeName)
getDataTypeMaxParameters in interface Databasepublic CatalogAndSchema getSchemaFromJdbcInfo(String rawCatalogName, String rawSchemaName)
public String getJdbcCatalogName(CatalogAndSchema schema)
public String getJdbcSchemaName(CatalogAndSchema schema)
public boolean dataTypeIsNotModifiable(String typeName)
DatabasedataTypeIsNotModifiable in interface DatabasetypeName - type namepublic String generateDatabaseFunctionValue(DatabaseFunction databaseFunction)
DatabasegenerateDatabaseFunctionValue in interface DatabasedatabaseFunction - database function to check.public void setObjectQuotingStrategy(ObjectQuotingStrategy quotingStrategy)
setObjectQuotingStrategy in interface Databasepublic ObjectQuotingStrategy getObjectQuotingStrategy()
getObjectQuotingStrategy in interface Databasepublic boolean supportsCatalogInObjectName(Class<? extends DatabaseObject> type)
supportsCatalogInObjectName in interface Databasepublic boolean createsIndexesForForeignKeys()
createsIndexesForForeignKeys in interface Databasepublic void setOutputDefaultSchema(boolean outputDefaultSchema)
DatabasesetOutputDefaultSchema in interface Databasepublic boolean getOutputDefaultSchema()
getOutputDefaultSchema in interface Databasepublic boolean getOutputDefaultCatalog()
getOutputDefaultCatalog in interface Databasepublic void setOutputDefaultCatalog(boolean outputDefaultCatalog)
setOutputDefaultCatalog in interface Databasepublic boolean isDefaultSchema(String catalog, String schema)
isDefaultSchema in interface Databasepublic boolean isDefaultCatalog(String catalog)
isDefaultCatalog in interface Databasepublic boolean supportsPrimaryKeyNames()
supportsPrimaryKeyNames in interface Databasepublic String getSystemSchema()
getSystemSchema in interface Databasepublic void addReservedWords(Collection<String> words)
addReservedWords in interface Databasepublic String escapeDataTypeName(String dataTypeName)
escapeDataTypeName in interface Databasepublic String unescapeDataTypeName(String dataTypeName)
unescapeDataTypeName in interface Databasepublic String unescapeDataTypeString(String dataTypeString)
unescapeDataTypeString in interface Databasepublic ValidationErrors validate()
Copyright © 2018 Liquibase.org. All rights reserved.