public class MySqlDbmsBean extends AbstractDbmsBean
DbmsBean.ColumnDefinition, DbmsBean.ConstraintDefinition, DbmsBean.IndexDefinition
LARGE_STRING_TYPE
Constructor and Description |
---|
MySqlDbmsBean() |
Modifier and Type | Method and Description |
---|---|
void |
actuallyChangeColumnToNotNull(Connection c,
String tableName,
String columnName) |
protected void |
changeColumnDefinition(Connection c,
String table,
String column,
String sqlType,
boolean isNullable) |
void |
changeTableNameToUpperCase(Connection connection,
String oldName)
Rename table from lower case to upper case.
|
void |
dropConstraint(Connection c,
String tableName,
String constraint)
Drop constraint
|
protected void |
dropConstraints(Connection connection,
String tableName,
String columnName) |
void |
dropForeignKeyConstraint(Connection c,
String tableName,
String foreignKey) |
void |
dropPrimaryKey(Connection connection,
String tableName)
Drops the primary key on a table.
|
String |
getConcat(String... values)
Provide a different SQL concatenation operator depending on SQL engine used.
|
Collection<DbmsBean.ConstraintDefinition> |
getConstraints(Connection connection,
String table,
String column)
Fetch information about constraints
|
DatabaseType |
getDatabaseType()
Detect used database type
|
String |
getQuery(SqlQueryProvider sqlQueryProvider)
Provide a different SQL query depending on SQL engine used.
|
boolean |
isMySql() |
protected DbmsBean.ColumnDefinition |
newColumnDefinition(String columnName,
int dataType,
String dataTypeName,
OptionalInt columnSize,
Optional<Boolean> isNullable) |
String |
quote(String name)
Quotes the supplied name according to the quoting rules of the underlying DBMS.
|
void |
renameColumn(Connection c,
String tableName,
String oldName,
String newName)
Rename columns.
|
void |
resizeVarcharColumn(Connection connection,
String tableName,
String columnName,
int newSize,
boolean isNullable,
String defaultValue) |
addColumn, changeColumnToNotNull, changeColumnType, clobEquals, createColumn, createIndex, createPrimaryKey, createUniqueConstraint, dropColumn, dropIndex, dropIndexIfExists, dropTable, getColumnDefinition, getColumns, getConstraintDefinitions, getConstraintType, getIndexNames, getIndices, getLargeTextTypeName, getSchema, getSchemaUncached, getSqlTypeName, getTables, isColumnPresent, isColumnPresent, isColumnPresent, isH2, isHsqldb, isMsSqlServer, isOracle, isPostgreSql, isTable, isTablePresent, migrateColumnType, quoteIfNeeded, toLowerCase
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCatalog
@NotNull public String getQuery(@NotNull SqlQueryProvider sqlQueryProvider)
DbmsBean
@NotNull public Collection<DbmsBean.ConstraintDefinition> getConstraints(Connection connection, @NotNull String table, @Nullable String column) throws SQLException
DbmsBean
SQLException
@NotNull public String getConcat(String... values)
DbmsBean
values
- the values to concatenate.public void resizeVarcharColumn(@NotNull Connection connection, String tableName, String columnName, int newSize, boolean isNullable, @Nullable String defaultValue) throws SQLException
SQLException
public boolean isMySql()
isMySql
in interface DbmsBean
isMySql
in class AbstractDbmsBean
public DatabaseType getDatabaseType()
BambooDatabaseTypeProvider
protected void changeColumnDefinition(Connection c, String table, String column, String sqlType, boolean isNullable) throws SQLException
changeColumnDefinition
in class AbstractDbmsBean
SQLException
protected void dropConstraints(Connection connection, String tableName, String columnName)
dropConstraints
in class AbstractDbmsBean
public void dropConstraint(Connection c, String tableName, String constraint) throws SQLException
DbmsBean
dropConstraint
in interface DbmsBean
dropConstraint
in class AbstractDbmsBean
SQLException
- if constraint does not existpublic void dropForeignKeyConstraint(Connection c, String tableName, String foreignKey) throws SQLException
dropForeignKeyConstraint
in interface DbmsBean
dropForeignKeyConstraint
in class AbstractDbmsBean
SQLException
public void actuallyChangeColumnToNotNull(Connection c, String tableName, String columnName) throws SQLException
actuallyChangeColumnToNotNull
in class AbstractDbmsBean
SQLException
public String quote(String name)
DbmsBean
quote
in interface DbmsBean
quote
in class AbstractDbmsBean
public void changeTableNameToUpperCase(Connection connection, String oldName) throws SQLException
DbmsBean
changeTableNameToUpperCase
in interface DbmsBean
changeTableNameToUpperCase
in class AbstractDbmsBean
SQLException
public void dropPrimaryKey(Connection connection, String tableName) throws SQLException
DbmsBean
SQLException
public void renameColumn(Connection c, String tableName, String oldName, String newName) throws SQLException
DbmsBean
renameColumn
in interface DbmsBean
renameColumn
in class AbstractDbmsBean
SQLException
protected DbmsBean.ColumnDefinition newColumnDefinition(String columnName, int dataType, String dataTypeName, OptionalInt columnSize, Optional<Boolean> isNullable)
newColumnDefinition
in class AbstractDbmsBean
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.