Package liquibase.database.core
Class SybaseDatabase
- java.lang.Object
-
- liquibase.database.AbstractJdbcDatabase
-
- liquibase.database.core.SybaseDatabase
-
- All Implemented Interfaces:
AutoCloseable
,Database
,PrioritizedService
public class SybaseDatabase extends AbstractJdbcDatabase
Encapsulates Sybase ASE database support.
-
-
Field Summary
Fields Modifier and Type Field Description static String
PRODUCT_NAME
protected Set<String>
systemTablesAndViews
-
Fields inherited from class liquibase.database.AbstractJdbcDatabase
caseSensitive, currentDateTimeFunction, dateFunctions, defaultAutoIncrementBy, defaultAutoIncrementStartWith, defaultCatalogName, defaultSchemaName, quotingStrategy, sequenceCurrentValueFunction, sequenceNextValueFunction, unmodifiableDataTypes, unquotedObjectsAreUppercased
-
Fields inherited from interface liquibase.database.Database
COMPLETE_SQL_SCOPE_KEY
-
Fields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description SybaseDatabase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
escapeIndexName(String catalogName, String schemaName, String indexName)
protected boolean
generateAutoIncrementBy(BigInteger incrementBy)
protected boolean
generateAutoIncrementStartWith(BigInteger startWith)
String
generateDefaultConstraintName(String tableName, String columnName)
protected String
getAutoIncrementClause()
String
getConcatSql(String... values)
Returns SQL to concat the passed values.protected SqlStatement
getConnectionSchemaNameCallStatement()
Used to obtain the connection schema name through a statement Override this method to change the statement.int
getDatabaseMajorVersion()
int
getDatabaseMinorVersion()
protected String
getDefaultDatabaseProductName()
String
getDefaultDriver(String url)
If this database understands the given url, return the default driver class name.Integer
getDefaultPort()
int
getPriority()
protected String
getQuotingEndCharacter()
protected String
getQuotingStartCharacter()
String
getShortName()
Returns an all-lower-case short name of the product.Set<String>
getSystemViews()
Returns system (undroppable) views.String
getViewDefinition(CatalogAndSchema schema, String viewName)
boolean
isCorrectDatabaseImplementation(DatabaseConnection conn)
Is this AbstractDatabase subclass the correct one to use for the given connection.boolean
isSystemObject(DatabaseObject example)
protected boolean
mustQuoteObjectName(String objectName, Class<? extends DatabaseObject> objectType)
String
quoteObject(String objectName, Class<? extends DatabaseObject> objectType)
boolean
requiresExplicitNullForColumns()
Does the database require explicit NULL for nullable columns?boolean
supportsDDLInTransaction()
Sybase does not support DDL and meta data in transactions properly, as such we turn off the commit and turn on auto commit.boolean
supportsDropTableCascadeConstraints()
boolean
supportsInitiallyDeferrableColumns()
Returns whether this database support initially deferrable columns.boolean
supportsRestrictForeignKeys()
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, escapeDataTypeName, escapeObjectName, escapeObjectName, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeRollbackStatements, executeStatements, filterRollbackVisitors, generateDatabaseFunctionValue, generatePrimaryKeyName, get, getAutoCommitMode, getAutoIncrementByClause, getAutoIncrementClause, getAutoIncrementClause, getAutoIncrementClosing, getAutoIncrementOpening, getAutoIncrementStartWithClause, getConnection, getConnectionCatalogName, getConnectionSchemaName, getContainingObjects, getCurrentDateTimeFunction, getDatabaseChangeLogLockTableName, getDatabaseChangeLogTableName, getDatabaseProductName, getDatabaseProductVersion, getDataTypeMaxParameters, getDateFunctions, getDateLiteral, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultCatalogName, getDefaultFractionalDigitsForTimestamp, getDefaultScaleForNativeDataType, getDefaultSchema, getDefaultSchemaName, getFetchSize, getJdbcCatalogName, getJdbcCatalogName, getJdbcSchemaName, getJdbcSchemaName, getLineComment, getLiquibaseCatalogName, getLiquibaseSchemaName, getLiquibaseTablespaceName, getMaxFractionalDigitsForTimestamp, getName, getObjectQuotingStrategy, getOutputDefaultCatalog, getOutputDefaultSchema, getQuotingEndReplacement, getRanChangeSet, getRanChangeSetList, getRanDate, getRawDatabaseChangeLogLockTableName, getRawDatabaseChangeLogTableName, getRunStatus, getSchemaAndCatalogCase, getSchemaFromJdbcInfo, getSystemSchema, getSystemTables, getTimeLiteral, hashCode, isAutoCommit, isCaseSensitive, isCatalogOrSchemaType, isCurrentTimeFunction, isDateOnly, isDateTime, isDefaultCatalog, isDefaultSchema, isFunction, isLiquibaseObject, isReservedWord, isSafeToRunUpdate, isSystemView, isTimeOnly, isTimestamp, jdbcCallsCatalogsSchemas, markChangeSetExecStatus, parseDate, removeRanStatus, requiresPassword, requiresUsername, resetInternalState, rollback, saveRollbackStatement, saveStatements, set, setAutoCommit, setCanCacheLiquibaseTableInfo, setCaseSensitive, setConnection, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultCatalogName, setDefaultSchemaName, setLiquibaseCatalogName, setLiquibaseSchemaName, setLiquibaseTablespaceName, setObjectQuotingStrategy, setOutputDefaultCatalog, setOutputDefaultSchema, startsWithNumeric, supportsAutoIncrement, supportsBatchUpdates, supportsCatalogInObjectName, supportsCatalogs, supportsForeignKeyDisable, supportsNotNullConstraintNames, supportsPrimaryKeyNames, supportsSchemas, tag, toString, unescapeDataTypeName, unescapeDataTypeString, validate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface liquibase.database.Database
addCompleteSqlToScope, afterUpdate, dropDatabaseObjects, failOnDefferable, getDisplayName, supportsCreateIfNotExists, supportsDatabaseChangeLogHistory, temporarilySetObjectQuotingStrategy
-
-
-
-
Field Detail
-
PRODUCT_NAME
public static final String PRODUCT_NAME
- See Also:
- Constant Field Values
-
-
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.
-
getPriority
public int getPriority()
-
getDefaultPort
public Integer getDefaultPort()
-
getDefaultDatabaseProductName
protected String getDefaultDatabaseProductName()
- Specified by:
getDefaultDatabaseProductName
in classAbstractJdbcDatabase
-
supportsDDLInTransaction
public boolean supportsDDLInTransaction()
Sybase does not support DDL and meta data in transactions properly, as such we turn off the commit and turn on auto commit.- Specified by:
supportsDDLInTransaction
in interfaceDatabase
- Overrides:
supportsDDLInTransaction
in classAbstractJdbcDatabase
- Returns:
- True if the database supports DDL within a transaction, otherwise false.
-
getSystemViews
public Set<String> getSystemViews()
Description copied from class:AbstractJdbcDatabase
Returns system (undroppable) views.- Overrides:
getSystemViews
in classAbstractJdbcDatabase
-
supportsInitiallyDeferrableColumns
public boolean supportsInitiallyDeferrableColumns()
Description copied from interface:Database
Returns whether this database support initially deferrable columns.
-
supportsSequences
public boolean supportsSequences()
Description copied from class:AbstractJdbcDatabase
Does the database type support sequence.- Specified by:
supportsSequences
in interfaceDatabase
- Overrides:
supportsSequences
in classAbstractJdbcDatabase
-
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.
-
getAutoIncrementClause
protected String getAutoIncrementClause()
- Overrides:
getAutoIncrementClause
in classAbstractJdbcDatabase
-
generateAutoIncrementStartWith
protected boolean generateAutoIncrementStartWith(BigInteger startWith)
- Overrides:
generateAutoIncrementStartWith
in classAbstractJdbcDatabase
-
generateAutoIncrementBy
protected boolean generateAutoIncrementBy(BigInteger incrementBy)
- Overrides:
generateAutoIncrementBy
in classAbstractJdbcDatabase
-
getConcatSql
public String getConcatSql(String... values)
Description copied from interface:Database
Returns SQL to concat the passed values.- Specified by:
getConcatSql
in interfaceDatabase
- Overrides:
getConcatSql
in classAbstractJdbcDatabase
-
supportsTablespaces
public boolean supportsTablespaces()
-
isSystemObject
public boolean isSystemObject(DatabaseObject example)
- Specified by:
isSystemObject
in interfaceDatabase
- Overrides:
isSystemObject
in classAbstractJdbcDatabase
-
generateDefaultConstraintName
public String generateDefaultConstraintName(String tableName, String columnName)
-
getConnectionSchemaNameCallStatement
protected SqlStatement getConnectionSchemaNameCallStatement()
Description copied from class:AbstractJdbcDatabase
Used to obtain the connection schema name through a statement Override this method to change the statement. Only override this if getConnectionSchemaName is left unchanged or is using this method.- Overrides:
getConnectionSchemaNameCallStatement
in classAbstractJdbcDatabase
- See Also:
AbstractJdbcDatabase.getConnectionSchemaName()
-
supportsRestrictForeignKeys
public boolean supportsRestrictForeignKeys()
- Specified by:
supportsRestrictForeignKeys
in interfaceDatabase
- Overrides:
supportsRestrictForeignKeys
in classAbstractJdbcDatabase
-
supportsDropTableCascadeConstraints
public boolean supportsDropTableCascadeConstraints()
- Specified by:
supportsDropTableCascadeConstraints
in interfaceDatabase
- Overrides:
supportsDropTableCascadeConstraints
in classAbstractJdbcDatabase
-
getViewDefinition
public String getViewDefinition(CatalogAndSchema schema, String viewName) throws DatabaseException
- Specified by:
getViewDefinition
in interfaceDatabase
- Overrides:
getViewDefinition
in classAbstractJdbcDatabase
- Throws:
DatabaseException
-
getDatabaseMajorVersion
public int getDatabaseMajorVersion() throws DatabaseException
- Specified by:
getDatabaseMajorVersion
in interfaceDatabase
- Overrides:
getDatabaseMajorVersion
in classAbstractJdbcDatabase
- Returns:
- the major version if supported, otherwise -1
- Throws:
DatabaseException
- See Also:
AbstractJdbcDatabase.getDatabaseMajorVersion()
-
getDatabaseMinorVersion
public int getDatabaseMinorVersion() throws DatabaseException
- Specified by:
getDatabaseMinorVersion
in interfaceDatabase
- Overrides:
getDatabaseMinorVersion
in classAbstractJdbcDatabase
- Returns:
- the minor version if supported, otherwise -1
- Throws:
DatabaseException
- See Also:
AbstractJdbcDatabase.getDatabaseMinorVersion()
-
escapeIndexName
public String escapeIndexName(String catalogName, String schemaName, String indexName)
- Specified by:
escapeIndexName
in interfaceDatabase
- Overrides:
escapeIndexName
in classAbstractJdbcDatabase
-
quoteObject
public String quoteObject(String objectName, Class<? extends DatabaseObject> objectType)
- Overrides:
quoteObject
in classAbstractJdbcDatabase
-
mustQuoteObjectName
protected boolean mustQuoteObjectName(String objectName, Class<? extends DatabaseObject> objectType)
- Overrides:
mustQuoteObjectName
in classAbstractJdbcDatabase
-
getQuotingStartCharacter
protected String getQuotingStartCharacter()
- Overrides:
getQuotingStartCharacter
in classAbstractJdbcDatabase
-
getQuotingEndCharacter
protected String getQuotingEndCharacter()
- Overrides:
getQuotingEndCharacter
in classAbstractJdbcDatabase
-
requiresExplicitNullForColumns
public boolean requiresExplicitNullForColumns()
Description copied from interface:Database
Does the database require explicit NULL for nullable columns?- Specified by:
requiresExplicitNullForColumns
in interfaceDatabase
- Overrides:
requiresExplicitNullForColumns
in classAbstractJdbcDatabase
- Returns:
- true if the database behaves incorrectly if NULL is not explicitly specified, false if it behaves like any good RDBMS should.
-
-