liquibase.database.core
Class MySQLDatabase

java.lang.Object
  extended by liquibase.database.AbstractJdbcDatabase
      extended by liquibase.database.core.MySQLDatabase
All Implemented Interfaces:
Database, PrioritizedService

public class MySQLDatabase
extends AbstractJdbcDatabase

Encapsulates MySQL database support.


Field Summary
static String PRODUCT_NAME
           
 
Fields inherited from class liquibase.database.AbstractJdbcDatabase
currentDateTimeFunction, dateFunctions, defaultAutoIncrementBy, defaultAutoIncrementStartWith, quotingEndCharacter, quotingStartCharacter, quotingStrategy, sequenceCurrentValueFunction, sequenceNextValueFunction, unmodifiableDataTypes, unquotedObjectsAreUppercased
 
Fields inherited from interface liquibase.servicelocator.PrioritizedService
PRIORITY_DATABASE, PRIORITY_DEFAULT
 
Constructor Summary
MySQLDatabase()
           
 
Method Summary
 String correctObjectName(String name, Class<? extends DatabaseObject> objectType)
          Fix the object name to the format the database expects, handling changes in case, etc.
 boolean disableForeignKeyChecks()
           
 void enableForeignKeyChecks()
           
 String escapeIndexName(String catalogName, String schemaName, String indexName)
           
protected  boolean generateAutoIncrementBy(BigInteger incrementBy)
           
protected  String getAutoIncrementClause()
           
protected  String getAutoIncrementClosing()
           
protected  String getAutoIncrementOpening()
           
protected  String getAutoIncrementStartWithClause()
           
 String getConcatSql(String... values)
          Returns SQL to concat the passed values.
protected  String getDefaultDatabaseProductName()
           
 String getDefaultDriver(String url)
          If this database understands the given url, return the default driver class name.
 Integer getDefaultPort()
           
 String getDefaultSchemaName()
           
 String getLineComment()
          Returns database-specific line comment string.
 int getPriority()
           
 CatalogAndSchema getSchemaFromJdbcInfo(String rawCatalogName, String rawSchemaName)
           
 String getShortName()
          Returns an all-lower-case short name of the product.
 boolean isCorrectDatabaseImplementation(DatabaseConnection conn)
          Is this AbstractDatabase subclass the correct one to use for the given connection.
 boolean supportsCatalogs()
           
 boolean supportsForeignKeyDisable()
           
 boolean supportsInitiallyDeferrableColumns()
          Returns whether this database support initially deferrable columns.
 boolean supportsSchemas()
           
 boolean supportsSequences()
          Does the database type support sequence.
 boolean supportsTablespaces()
           
 
Methods inherited from class liquibase.database.AbstractJdbcDatabase
canCreateChangeLogTable, checkDatabaseChangeLogLockTable, checkDatabaseChangeLogTable, close, commit, correctSchema, correctSchema, dataTypeIsNotModifiable, doesTagExist, doGetDefaultCatalogName, doGetDefaultSchemaName, dropDatabaseObjects, equals, escapeColumnName, escapeColumnNameList, escapeConstraintName, escapeObjectName, escapeObjectName, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeStatements, generateAutoIncrementStartWith, generateDatabaseFunctionValue, generatePrimaryKeyName, getAutoCommitMode, getAutoIncrementByClause, getAutoIncrementClause, getConnection, getContainingObjects, getCurrentDateTimeFunction, getDatabaseChangeLogLockTableName, getDatabaseChangeLogTableName, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductVersion, getDataTypeMaxParameters, getDateFunctions, getDateLiteral, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultCatalogName, getDefaultSchema, getJdbcCatalogName, getJdbcCatalogName, getJdbcSchemaName, getJdbcSchemaName, getLiquibaseCatalogName, getLiquibaseSchemaName, getLiquibaseTablespaceName, getName, getNextChangeSetSequenceValue, getObjectQuotingStrategy, getRanChangeSet, getRanChangeSetList, getRanDate, getRunStatus, getSystemTables, getSystemViews, getTimeLiteral, getViewDefinition, hasDatabaseChangeLogLockTable, hasDatabaseChangeLogTable, hashCode, isAutoCommit, isCaseSensitive, isDateOnly, isDateTime, isFunction, isLiquibaseObject, isReservedWord, isSafeToRunUpdate, isSystemObject, isSystemView, isTimeOnly, jdbcCallsCatalogsSchemas, markChangeSetExecStatus, parseDate, removeRanStatus, requiresPassword, requiresUsername, resetInternalState, resetRanChangeSetList, rollback, saveRollbackStatement, saveStatements, setAutoCommit, setCanCacheLiquibaseTableInfo, setConnection, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultCatalogName, setDefaultSchemaName, setLiquibaseTablespaceName, setObjectQuotingStrategy, startsWithNumeric, supportsAutoIncrement, supportsCatalogInObjectName, supportsDDLInTransaction, supportsDropTableCascadeConstraints, supportsRestrictForeignKeys, tag, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PRODUCT_NAME

public static final String PRODUCT_NAME
See Also:
Constant Field Values
Constructor Detail

MySQLDatabase

public MySQLDatabase()
Method Detail

getShortName

public String getShortName()
Description copied from interface: Database
Returns an all-lower-case short name of the product. Used for end-user selecting of database type such as the DBMS precondition.


correctObjectName

public String correctObjectName(String name,
                                Class<? extends DatabaseObject> objectType)
Description copied from interface: Database
Fix the object name to the format the database expects, handling changes in case, etc.

Specified by:
correctObjectName in interface Database
Overrides:
correctObjectName in class AbstractJdbcDatabase

getDefaultDatabaseProductName

protected String getDefaultDatabaseProductName()
Specified by:
getDefaultDatabaseProductName in class AbstractJdbcDatabase

getDefaultPort

public Integer getDefaultPort()

getPriority

public int getPriority()

isCorrectDatabaseImplementation

public boolean isCorrectDatabaseImplementation(DatabaseConnection conn)
                                        throws DatabaseException
Description copied from interface: Database
Is this AbstractDatabase subclass the correct one to use for the given connection.

Throws:
DatabaseException

getDefaultDriver

public String getDefaultDriver(String url)
Description copied from interface: Database
If this database understands the given url, return the default driver class name. Otherwise return null.


supportsSequences

public boolean supportsSequences()
Description copied from class: AbstractJdbcDatabase
Does the database type support sequence.

Specified by:
supportsSequences in interface Database
Overrides:
supportsSequences in class AbstractJdbcDatabase

supportsInitiallyDeferrableColumns

public boolean supportsInitiallyDeferrableColumns()
Description copied from interface: Database
Returns whether this database support initially deferrable columns.


getLineComment

public String getLineComment()
Description copied from class: AbstractJdbcDatabase
Returns database-specific line comment string.

Specified by:
getLineComment in interface Database
Overrides:
getLineComment in class AbstractJdbcDatabase

getAutoIncrementClause

protected String getAutoIncrementClause()
Overrides:
getAutoIncrementClause in class AbstractJdbcDatabase

generateAutoIncrementBy

protected boolean generateAutoIncrementBy(BigInteger incrementBy)
Overrides:
generateAutoIncrementBy in class AbstractJdbcDatabase

getAutoIncrementOpening

protected String getAutoIncrementOpening()
Overrides:
getAutoIncrementOpening in class AbstractJdbcDatabase

getAutoIncrementClosing

protected String getAutoIncrementClosing()
Overrides:
getAutoIncrementClosing in class AbstractJdbcDatabase

getAutoIncrementStartWithClause

protected String getAutoIncrementStartWithClause()
Overrides:
getAutoIncrementStartWithClause in class AbstractJdbcDatabase

getConcatSql

public String getConcatSql(String... values)
Description copied from interface: Database
Returns SQL to concat the passed values.

Specified by:
getConcatSql in interface Database
Overrides:
getConcatSql in class AbstractJdbcDatabase

supportsTablespaces

public boolean supportsTablespaces()

getDefaultSchemaName

public String getDefaultSchemaName()
Specified by:
getDefaultSchemaName in interface Database
Overrides:
getDefaultSchemaName in class AbstractJdbcDatabase

supportsSchemas

public boolean supportsSchemas()
Specified by:
supportsSchemas in interface Database
Overrides:
supportsSchemas in class AbstractJdbcDatabase

supportsCatalogs

public boolean supportsCatalogs()
Specified by:
supportsCatalogs in interface Database
Overrides:
supportsCatalogs in class AbstractJdbcDatabase

escapeIndexName

public String escapeIndexName(String catalogName,
                              String schemaName,
                              String indexName)
Specified by:
escapeIndexName in interface Database
Overrides:
escapeIndexName in class AbstractJdbcDatabase

supportsForeignKeyDisable

public boolean supportsForeignKeyDisable()
Specified by:
supportsForeignKeyDisable in interface Database
Overrides:
supportsForeignKeyDisable in class AbstractJdbcDatabase

disableForeignKeyChecks

public boolean disableForeignKeyChecks()
                                throws DatabaseException
Specified by:
disableForeignKeyChecks in interface Database
Overrides:
disableForeignKeyChecks in class AbstractJdbcDatabase
Throws:
DatabaseException

enableForeignKeyChecks

public void enableForeignKeyChecks()
                            throws DatabaseException
Specified by:
enableForeignKeyChecks in interface Database
Overrides:
enableForeignKeyChecks in class AbstractJdbcDatabase
Throws:
DatabaseException

getSchemaFromJdbcInfo

public CatalogAndSchema getSchemaFromJdbcInfo(String rawCatalogName,
                                              String rawSchemaName)
Overrides:
getSchemaFromJdbcInfo in class AbstractJdbcDatabase


Copyright © 2013 Liquibase.org. All Rights Reserved.