public class MsSqlDbmsBean extends AbstractDbmsBean
DbmsBean.ColumnDefinition, DbmsBean.ConstraintDefinition, DbmsBean.IndexDefinition
LARGE_STRING_TYPE
Constructor and Description |
---|
MsSqlDbmsBean() |
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.
|
@NotNull String |
clobEquals(@NotNull String columnName)
Comparison string for CLOB column.
|
protected void |
dropConstraints(Connection connection,
String tableName,
String columnName) |
void |
dropIndex(Connection c,
String table,
String index) |
void |
dropPrimaryKey(Connection connection,
String tableName)
Drops the primary key on a table.
|
@NotNull String |
getConcat(String... values)
Provide a different SQL concatenation operator depending on SQL engine used.
|
@NotNull Collection<DbmsBean.ConstraintDefinition> |
getConstraints(Connection connection,
@NotNull String table,
@Nullable String column)
Fetch information about constraints
|
DatabaseType |
getDatabaseType()
Detect used database type
|
@NotNull String |
getQuery(@NotNull SqlQueryProvider sqlQueryProvider)
Provide a different SQL query depending on SQL engine used.
|
protected @NotNull String |
getSqlTypeName(int type) |
boolean |
isColumnPresent(@NotNull Statement statement,
@NotNull String tableName,
@NotNull String columnName)
Checks whether given table contains the specified column.
|
boolean |
isMsSqlServer() |
protected DbmsBean.ColumnDefinition |
newColumnDefinition(String columnName,
int dataType,
String dataTypeName,
OptionalInt columnSize,
Optional<Boolean> isNullable) |
void |
renameColumn(Connection c,
String tableName,
String oldName,
String newName)
Rename columns.
|
void |
resizeVarcharColumn(@NotNull Connection connection,
String tableName,
String columnName,
int newSize,
boolean isNullable,
@Nullable String defaultValue) |
addColumn, changeColumnToNotNull, changeColumnType, createColumn, createIndex, createPrimaryKey, createUniqueConstraint, dropColumn, dropConstraint, dropForeignKeyConstraint, dropIndexIfExists, dropTable, getColumnDefinition, getColumns, getConstraintDefinitions, getConstraintType, getIndexNames, getIndices, getLargeTextTypeName, getSchema, getSchemaUncached, getTables, isColumnPresent, isColumnPresent, isH2, isHsqldb, isMySql, isOracle, isPostgreSql, isTable, isTablePresent, migrateColumnType, quote, quoteIfNeeded, toLowerCase
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCatalog
@NotNull public @NotNull String getQuery(@NotNull @NotNull SqlQueryProvider sqlQueryProvider)
DbmsBean
@NotNull public @NotNull String getConcat(String... values)
DbmsBean
values
- the values to concatenate.public void resizeVarcharColumn(@NotNull @NotNull Connection connection, String tableName, String columnName, int newSize, boolean isNullable, @Nullable @Nullable String defaultValue) throws SQLException
SQLException
public boolean isMsSqlServer()
isMsSqlServer
in interface DbmsBean
isMsSqlServer
in class AbstractDbmsBean
public DatabaseType getDatabaseType()
BambooDatabaseTypeProvider
public void dropIndex(Connection c, String table, String index) throws SQLException
dropIndex
in interface DbmsBean
dropIndex
in class AbstractDbmsBean
SQLException
protected void dropConstraints(Connection connection, String tableName, String columnName)
dropConstraints
in class AbstractDbmsBean
public boolean isColumnPresent(@NotNull @NotNull Statement statement, @NotNull @NotNull String tableName, @NotNull @NotNull String columnName) throws SQLException
DbmsBean
isColumnPresent
in interface DbmsBean
isColumnPresent
in class AbstractDbmsBean
SQLException
public void dropPrimaryKey(Connection connection, String tableName) throws SQLException
DbmsBean
SQLException
@NotNull public @NotNull Collection<DbmsBean.ConstraintDefinition> getConstraints(Connection connection, @NotNull @NotNull String table, @Nullable @Nullable String column) throws SQLException
DbmsBean
SQLException
public void changeTableNameToUpperCase(Connection connection, String oldName) throws SQLException
DbmsBean
changeTableNameToUpperCase
in interface DbmsBean
changeTableNameToUpperCase
in class AbstractDbmsBean
SQLException
public void renameColumn(Connection c, String tableName, String oldName, String newName) throws SQLException
DbmsBean
renameColumn
in interface DbmsBean
renameColumn
in class AbstractDbmsBean
SQLException
@NotNull public @NotNull String clobEquals(@NotNull @NotNull String columnName)
DbmsBean
clobEquals
in interface DbmsBean
clobEquals
in class AbstractDbmsBean
columnName
- column nameprotected DbmsBean.ColumnDefinition newColumnDefinition(String columnName, int dataType, String dataTypeName, OptionalInt columnSize, Optional<Boolean> isNullable)
newColumnDefinition
in class AbstractDbmsBean
public void actuallyChangeColumnToNotNull(Connection c, String tableName, String columnName) throws SQLException
actuallyChangeColumnToNotNull
in class AbstractDbmsBean
SQLException
protected void changeColumnDefinition(Connection c, String table, String column, String sqlType, boolean isNullable) throws SQLException
changeColumnDefinition
in class AbstractDbmsBean
SQLException
@NotNull protected @NotNull String getSqlTypeName(int type)
getSqlTypeName
in class AbstractDbmsBean
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.