Package com.atlassian.bamboo.utils.db
Class OracleDbmsBean
- java.lang.Object
-
- com.atlassian.bamboo.utils.db.AbstractDbmsBean
-
- com.atlassian.bamboo.utils.db.OracleDbmsBean
-
- All Implemented Interfaces:
BambooDatabaseTypeProvider,DbmsBean
public class OracleDbmsBean extends AbstractDbmsBean
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.bamboo.utils.db.DbmsBean
DbmsBean.ColumnDefinition, DbmsBean.ConstraintDefinition, DbmsBean.IndexDefinition
-
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.utils.db.AbstractDbmsBean
LARGE_STRING_TYPE
-
-
Constructor Summary
Constructors Constructor Description OracleDbmsBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactuallyChangeColumnToNotNull(Connection c, String tableName, String columnName)@NotNull StringclobEquals(@NotNull String columnName)Comparison string for CLOB column.voiddropIndex(Connection c, String table, String index)voiddropPrimaryKey(Connection connection, String tableName)Drops the primary key on a table.@NotNull StringgetConcat(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 constraintsprotected DbmsBean.ConstraintDefinition.ConstraintTypegetConstraintType(String typeName)https://docs.oracle.com/database/121/REFRN/GUID-9C96DA92-CFE0-4A3F-9061-C5ED17B43EFE.htm#REFRN20047DatabaseTypegetDatabaseType()Detect used database typeCollection<DbmsBean.IndexDefinition>getIndices(@NotNull Connection c, @NotNull String table)@NotNull StringgetQuery(@NotNull SqlQueryProvider sqlQueryProvider)Provide a different SQL query depending on SQL engine used.booleanisOracle()voidrenameColumn(Connection c, String tableName, String oldName, String newName)Rename columns.voidresizeVarcharColumn(@NotNull Connection connection, String tableName, String columnName, int newSize, boolean isNullable, @Nullable String defaultValue)-
Methods inherited from class com.atlassian.bamboo.utils.db.AbstractDbmsBean
addColumn, changeColumnDefinition, changeColumnToNotNull, changeColumnType, changeTableNameToUpperCase, createColumn, createIndex, createPrimaryKey, createUniqueConstraint, dropColumn, dropConstraint, dropConstraints, dropForeignKeyConstraint, dropIndexIfExists, dropTable, getColumnDefinition, getColumnDefinitionString, getColumns, getConstraintDefinitions, getIndexNames, getLargeTextTypeName, getSchema, getSchemaUncached, getSqlTypeName, getTables, hasIndexOnColumns, isColumnPresent, isColumnPresent, isColumnPresent, isH2, isHsqldb, isMsSqlServer, isMySql, isPostgreSql, isTable, isTablePresent, migrateColumnType, newColumnDefinition, quote, quoteIfNeeded, toLowerCase, unquoteIfNeeded
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.utils.db.DbmsBean
getCatalog
-
-
-
-
Method Detail
-
getConstraints
@NotNull public @NotNull Collection<DbmsBean.ConstraintDefinition> getConstraints(Connection connection, @NotNull @NotNull String table, @Nullable @Nullable String column) throws SQLException
Description copied from interface:DbmsBeanFetch information about constraints- Throws:
SQLException
-
getConstraintType
protected DbmsBean.ConstraintDefinition.ConstraintType getConstraintType(String typeName)
https://docs.oracle.com/database/121/REFRN/GUID-9C96DA92-CFE0-4A3F-9061-C5ED17B43EFE.htm#REFRN20047- Overrides:
getConstraintTypein classAbstractDbmsBean
-
dropIndex
public void dropIndex(Connection c, String table, String index) throws SQLException
- Specified by:
dropIndexin interfaceDbmsBean- Overrides:
dropIndexin classAbstractDbmsBean- Throws:
SQLException
-
getQuery
@NotNull public @NotNull String getQuery(@NotNull @NotNull SqlQueryProvider sqlQueryProvider)
Description copied from interface:DbmsBeanProvide a different SQL query depending on SQL engine used.- Returns:
-
getConcat
@NotNull public @NotNull String getConcat(String... values)
Description copied from interface:DbmsBeanProvide a different SQL concatenation operator depending on SQL engine used.- Parameters:
values- the values to concatenate.- Returns:
- the concatenation SQL to append to a query.
-
resizeVarcharColumn
public void resizeVarcharColumn(@NotNull @NotNull Connection connection, String tableName, String columnName, int newSize, boolean isNullable, @Nullable @Nullable String defaultValue) throws SQLException- Throws:
SQLException
-
isOracle
public boolean isOracle()
- Specified by:
isOraclein interfaceDbmsBean- Overrides:
isOraclein classAbstractDbmsBean- Returns:
- true if db configured in Hibernate is Oracle
-
getDatabaseType
public DatabaseType getDatabaseType()
Description copied from interface:BambooDatabaseTypeProviderDetect used database type- Returns:
- database type
-
dropPrimaryKey
public void dropPrimaryKey(Connection connection, String tableName) throws SQLException
Description copied from interface:DbmsBeanDrops the primary key on a table.- Throws:
SQLException
-
renameColumn
public void renameColumn(Connection c, String tableName, String oldName, String newName) throws SQLException
Description copied from interface:DbmsBeanRename columns.- Specified by:
renameColumnin interfaceDbmsBean- Specified by:
renameColumnin classAbstractDbmsBean- Throws:
SQLException
-
actuallyChangeColumnToNotNull
public void actuallyChangeColumnToNotNull(Connection c, String tableName, String columnName) throws SQLException
- Overrides:
actuallyChangeColumnToNotNullin classAbstractDbmsBean- Throws:
SQLException
-
getIndices
public Collection<DbmsBean.IndexDefinition> getIndices(@NotNull @NotNull Connection c, @NotNull @NotNull String table) throws SQLException
- Specified by:
getIndicesin interfaceDbmsBean- Overrides:
getIndicesin classAbstractDbmsBean- Throws:
SQLException
-
clobEquals
@NotNull public @NotNull String clobEquals(@NotNull @NotNull String columnName)
Description copied from interface:DbmsBeanComparison string for CLOB column.- Specified by:
clobEqualsin interfaceDbmsBean- Overrides:
clobEqualsin classAbstractDbmsBean- Parameters:
columnName- column name- Returns:
- string for prepared statement
-
-