liquibase.database.core
Class OracleDatabase

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

public class OracleDatabase
extends AbstractJdbcDatabase

Encapsulates Oracle database support.


Field Summary
static String PRODUCT_NAME
           
 
Fields inherited from class liquibase.database.AbstractJdbcDatabase
caseSensitive, currentDateTimeFunction, dateFunctions, defaultAutoIncrementBy, defaultAutoIncrementStartWith, defaultCatalogName, defaultSchemaName, quotingEndCharacter, quotingStartCharacter, quotingStrategy, sequenceCurrentValueFunction, sequenceNextValueFunction, unmodifiableDataTypes, unquotedObjectsAreUppercased
 
Fields inherited from interface liquibase.servicelocator.PrioritizedService
PRIORITY_DATABASE, PRIORITY_DEFAULT
 
Constructor Summary
OracleDatabase()
           
 
Method Summary
 String generateDatabaseFunctionValue(DatabaseFunction databaseFunction)
          Some function names are placeholders that need to be replaced with the specific database value.
 String generatePrimaryKeyName(String tableName)
           
protected  String getConnectionCatalogName()
           
 int getDataTypeMaxParameters(String dataTypeName)
           
 String getDateLiteral(String isoDate)
          Return an Oracle date literal with the same value as a string formatted using ISO 8601.
 String getDefaultCatalogName()
           
protected  String getDefaultDatabaseProductName()
           
 String getDefaultDriver(String url)
          If this database understands the given url, return the default driver class name.
 Integer getDefaultPort()
           
 String getJdbcCatalogName(CatalogAndSchema schema)
           
 String getJdbcSchemaName(CatalogAndSchema schema)
           
 int getPriority()
           
 String getShortName()
          Returns an all-lower-case short name of the product.
 Set<String> getUserDefinedTypes()
           
 boolean isCorrectDatabaseImplementation(DatabaseConnection conn)
          Is this AbstractDatabase subclass the correct one to use for the given connection.
 boolean isReservedWord(String objectName)
           
 boolean isSystemObject(DatabaseObject example)
           
 boolean jdbcCallsCatalogsSchemas()
           
 void setConnection(DatabaseConnection conn)
           
 boolean supportsAutoIncrement()
           
 boolean supportsInitiallyDeferrableColumns()
          Returns whether this database support initially deferrable columns.
 boolean supportsRestrictForeignKeys()
           
 boolean supportsSchemas()
          Oracle supports catalogs in liquibase terms
 boolean supportsSequences()
          Does the database type support sequence.
 boolean supportsTablespaces()
           
 
Methods inherited from class liquibase.database.AbstractJdbcDatabase
addReservedWords, canCreateChangeLogTable, close, commit, correctObjectName, correctSchema, correctSchema, createsIndexesForForeignKeys, dataTypeIsNotModifiable, disableForeignKeyChecks, doesTagExist, dropDatabaseObjects, enableForeignKeyChecks, equals, escapeColumnName, escapeColumnName, escapeColumnNameList, escapeConstraintName, escapeIndexName, escapeObjectName, escapeObjectName, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeRollbackStatements, executeStatements, filterRollbackVisitors, generateAutoIncrementBy, generateAutoIncrementStartWith, getAutoCommitMode, getAutoIncrementByClause, getAutoIncrementClause, getAutoIncrementClause, getAutoIncrementClosing, getAutoIncrementOpening, getAutoIncrementStartWithClause, getConcatSql, getConnection, getConnectionSchemaName, getContainingObjects, getCurrentDateTimeFunction, getDatabaseChangeLogLockTableName, getDatabaseChangeLogTableName, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductVersion, getDateFunctions, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultSchema, getDefaultSchemaName, getJdbcCatalogName, getJdbcSchemaName, getLineComment, getLiquibaseCatalogName, getLiquibaseSchemaName, getLiquibaseTablespaceName, getName, getObjectQuotingStrategy, getOutputDefaultCatalog, getOutputDefaultSchema, getRanChangeSet, getRanChangeSetList, getRanDate, getRunStatus, getSchemaFromJdbcInfo, getSystemSchema, getSystemTables, getSystemViews, getTimeLiteral, getViewDefinition, hashCode, isAutoCommit, isCaseSensitive, isDateOnly, isDateTime, isDefaultCatalog, isDefaultSchema, isFunction, isLiquibaseObject, isSafeToRunUpdate, isSystemView, isTimeOnly, markChangeSetExecStatus, mustQuoteObjectName, parseDate, quoteObject, removeRanStatus, requiresPassword, requiresUsername, resetInternalState, rollback, saveRollbackStatement, saveStatements, setAutoCommit, setCanCacheLiquibaseTableInfo, setCaseSensitive, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultCatalogName, setDefaultSchemaName, setLiquibaseCatalogName, setLiquibaseSchemaName, setLiquibaseTablespaceName, setObjectQuotingStrategy, setOutputDefaultCatalog, setOutputDefaultSchema, startsWithNumeric, supportsCatalogInObjectName, supportsCatalogs, supportsDDLInTransaction, supportsDropTableCascadeConstraints, supportsForeignKeyDisable, supportsPrimaryKeyNames, 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

OracleDatabase

public OracleDatabase()
Method Detail

getPriority

public int getPriority()

setConnection

public void setConnection(DatabaseConnection conn)
Specified by:
setConnection in interface Database
Overrides:
setConnection in class AbstractJdbcDatabase

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.


getDefaultDatabaseProductName

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

getDefaultPort

public Integer getDefaultPort()

getJdbcCatalogName

public String getJdbcCatalogName(CatalogAndSchema schema)
Overrides:
getJdbcCatalogName in class AbstractJdbcDatabase

getJdbcSchemaName

public String getJdbcSchemaName(CatalogAndSchema schema)
Overrides:
getJdbcSchemaName in class AbstractJdbcDatabase

generatePrimaryKeyName

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

supportsInitiallyDeferrableColumns

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


isReservedWord

public boolean isReservedWord(String objectName)
Specified by:
isReservedWord in interface Database
Overrides:
isReservedWord in class AbstractJdbcDatabase

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

supportsSchemas

public boolean supportsSchemas()
Oracle supports catalogs in liquibase terms

Specified by:
supportsSchemas in interface Database
Overrides:
supportsSchemas in class AbstractJdbcDatabase
Returns:

getConnectionCatalogName

protected String getConnectionCatalogName()
                                   throws DatabaseException
Overrides:
getConnectionCatalogName in class AbstractJdbcDatabase
Throws:
DatabaseException

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.


getDefaultCatalogName

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

getDateLiteral

public String getDateLiteral(String isoDate)
Return an Oracle date literal with the same value as a string formatted using ISO 8601.

Convert an ISO8601 date string to one of the following results: to_date('1995-05-23', 'YYYY-MM-DD') to_date('1995-05-23 09:23:59', 'YYYY-MM-DD HH24:MI:SS')

Implementation restriction: Currently, only the following subsets of ISO8601 are supported: YYYY-MM-DD YYYY-MM-DDThh:mm:ss

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

isSystemObject

public boolean isSystemObject(DatabaseObject example)
Specified by:
isSystemObject in interface Database
Overrides:
isSystemObject in class AbstractJdbcDatabase

supportsTablespaces

public boolean supportsTablespaces()

supportsAutoIncrement

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

supportsRestrictForeignKeys

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

getDataTypeMaxParameters

public int getDataTypeMaxParameters(String dataTypeName)
Specified by:
getDataTypeMaxParameters in interface Database
Overrides:
getDataTypeMaxParameters in class AbstractJdbcDatabase

jdbcCallsCatalogsSchemas

public boolean jdbcCallsCatalogsSchemas()
Overrides:
jdbcCallsCatalogsSchemas in class AbstractJdbcDatabase

getUserDefinedTypes

public Set<String> getUserDefinedTypes()

generateDatabaseFunctionValue

public String generateDatabaseFunctionValue(DatabaseFunction databaseFunction)
Description copied from interface: Database
Some function names are placeholders that need to be replaced with the specific database value. e.g. nextSequenceValue(sequenceName) should be replaced with NEXT_VAL('sequenceName') for Postgresql

Specified by:
generateDatabaseFunctionValue in interface Database
Overrides:
generateDatabaseFunctionValue in class AbstractJdbcDatabase
Parameters:
databaseFunction - database function to check.
Returns:
the string value to use for an update or generate


Copyright © 2014 Liquibase.org. All rights reserved.