liquibase.database.core
Class SybaseDatabase

java.lang.Object
  extended by liquibase.database.AbstractDatabase
      extended by liquibase.database.core.SybaseDatabase
All Implemented Interfaces:
Database, DatabaseObject, PrioritizedService

public class SybaseDatabase
extends AbstractDatabase

Encapsulates Sybase ASE database support.


Field Summary
static String PRODUCT_NAME
           
protected  Set<String> systemTablesAndViews
           
 
Fields inherited from class liquibase.database.AbstractDatabase
currentDateTimeFunction, databaseFunctions
 
Fields inherited from interface liquibase.servicelocator.PrioritizedService
PRIORITY_DATABASE, PRIORITY_DEFAULT
 
Constructor Summary
SybaseDatabase()
           
 
Method Summary
 String convertRequestedSchemaToCatalog(String requestedSchema)
           
 String convertRequestedSchemaToSchema(String requestedSchema)
           
 String escapeDatabaseObject(String objectName)
           
 String escapeIndexName(String schemaName, String indexName)
           
 String generateDefaultConstraintName(String tableName, String columnName)
           
 String getAutoIncrementClause()
          Returns database-specific auto-increment DDL clause.
 String getConcatSql(String... values)
          Returns SQL to concat the passed values.
 String getCurrentDateTimeFunction()
          Returns database-specific function for generating the current date/time.
 int getDatabaseMajorVersion()
           
 int getDatabaseMinorVersion()
           
 String getDefaultCatalogName()
           
protected  String getDefaultDatabaseSchemaName()
           
 String getDefaultDriver(String url)
          If this database understands the given url, return the default driver class name.
 int getPriority()
           
 String getProductName()
           
 Set<String> getSystemTablesAndViews()
          Returns system (undroppable) tables and views.
 String getTypeName()
          Returns an all-lower-case short name of the product.
 String getViewDefinition(String schemaName, String viewName)
           
 boolean isCorrectDatabaseImplementation(DatabaseConnection conn)
          Is this AbstractDatabase subclass the correct one to use for the given connection.
 boolean isSystemTable(String catalogName, String schemaName, String tableName)
           
 boolean isSystemView(String catalogName, String schemaName, String viewName)
           
 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 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.AbstractDatabase
canCreateChangeLogTable, checkDatabaseChangeLogLockTable, checkDatabaseChangeLogTable, close, commit, disableForeignKeyChecks, doesTagExist, dropDatabaseObjects, enableForeignKeyChecks, equals, escapeColumnName, escapeColumnNameList, escapeConstraintName, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeStatements, generatePrimaryKeyName, getAutoCommitMode, getConnection, getContainingObjects, getDatabaseChangeLogLockTableName, getDatabaseChangeLogTableName, getDatabaseFunctions, getDatabaseProductName, getDatabaseProductVersion, getDateLiteral, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultSchemaName, getLineComment, getLiquibaseSchemaName, getNextChangeSetSequenceValue, getRanChangeSet, getRanChangeSetList, getRanDate, getRunStatus, getTable, getTimeLiteral, hasDatabaseChangeLogLockTable, hasDatabaseChangeLogTable, hashCode, isAutoCommit, isDateOnly, isDateTime, isLiquibaseTable, isLocalDatabase, isReservedWord, isTimeOnly, markChangeSetExecStatus, parseDate, removeRanStatus, requiresPassword, requiresUsername, reset, rollback, saveRollbackStatement, saveStatements, setAutoCommit, setCanCacheLiquibaseTableInfo, setConnection, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultSchemaName, shouldQuoteValue, supportsAutoIncrement, supportsDropTableCascadeConstraints, supportsForeignKeyDisable, supportsSchemas, 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

systemTablesAndViews

protected Set<String> systemTablesAndViews
Constructor Detail

SybaseDatabase

public SybaseDatabase()
Method Detail

getProductName

public String getProductName()

getTypeName

public String getTypeName()
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()

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 interface Database
Overrides:
supportsDDLInTransaction in class AbstractDatabase
Returns:
True if the database supports DDL within a transaction, otherwise false.

getSystemTablesAndViews

public Set<String> getSystemTablesAndViews()
Description copied from class: AbstractDatabase
Returns system (undroppable) tables and views.

Overrides:
getSystemTablesAndViews in class AbstractDatabase

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: AbstractDatabase
Does the database type support sequence.

Specified by:
supportsSequences in interface Database
Overrides:
supportsSequences in class AbstractDatabase

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.


getCurrentDateTimeFunction

public String getCurrentDateTimeFunction()
Description copied from interface: Database
Returns database-specific function for generating the current date/time.


getAutoIncrementClause

public String getAutoIncrementClause()
Description copied from class: AbstractDatabase
Returns database-specific auto-increment DDL clause.

Specified by:
getAutoIncrementClause in interface Database
Overrides:
getAutoIncrementClause in class AbstractDatabase

getDefaultDatabaseSchemaName

protected String getDefaultDatabaseSchemaName()
                                       throws DatabaseException
Overrides:
getDefaultDatabaseSchemaName in class AbstractDatabase
Throws:
DatabaseException

getDefaultCatalogName

public String getDefaultCatalogName()
                             throws DatabaseException
Specified by:
getDefaultCatalogName in interface Database
Overrides:
getDefaultCatalogName in class AbstractDatabase
Throws:
DatabaseException

getConcatSql

public String getConcatSql(String... values)
Description copied from interface: Database
Returns SQL to concat the passed values.

Specified by:
getConcatSql in interface Database
Overrides:
getConcatSql in class AbstractDatabase

supportsTablespaces

public boolean supportsTablespaces()

isSystemTable

public boolean isSystemTable(String catalogName,
                             String schemaName,
                             String tableName)
Specified by:
isSystemTable in interface Database
Overrides:
isSystemTable in class AbstractDatabase

isSystemView

public boolean isSystemView(String catalogName,
                            String schemaName,
                            String viewName)
Specified by:
isSystemView in interface Database
Overrides:
isSystemView in class AbstractDatabase

generateDefaultConstraintName

public String generateDefaultConstraintName(String tableName,
                                            String columnName)

convertRequestedSchemaToCatalog

public String convertRequestedSchemaToCatalog(String requestedSchema)
                                       throws DatabaseException
Specified by:
convertRequestedSchemaToCatalog in interface Database
Overrides:
convertRequestedSchemaToCatalog in class AbstractDatabase
Throws:
DatabaseException

convertRequestedSchemaToSchema

public String convertRequestedSchemaToSchema(String requestedSchema)
                                      throws DatabaseException
Specified by:
convertRequestedSchemaToSchema in interface Database
Overrides:
convertRequestedSchemaToSchema in class AbstractDatabase
Throws:
DatabaseException

supportsRestrictForeignKeys

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

escapeDatabaseObject

public String escapeDatabaseObject(String objectName)
Specified by:
escapeDatabaseObject in interface Database
Overrides:
escapeDatabaseObject in class AbstractDatabase

getViewDefinition

public String getViewDefinition(String schemaName,
                                String viewName)
                         throws DatabaseException
Specified by:
getViewDefinition in interface Database
Overrides:
getViewDefinition in class AbstractDatabase
Throws:
DatabaseException

getDatabaseMajorVersion

public int getDatabaseMajorVersion()
                            throws DatabaseException
Specified by:
getDatabaseMajorVersion in interface Database
Overrides:
getDatabaseMajorVersion in class AbstractDatabase
Returns:
the major version if supported, otherwise -1
Throws:
DatabaseException
See Also:
AbstractDatabase.getDatabaseMajorVersion()

getDatabaseMinorVersion

public int getDatabaseMinorVersion()
                            throws DatabaseException
Specified by:
getDatabaseMinorVersion in interface Database
Overrides:
getDatabaseMinorVersion in class AbstractDatabase
Returns:
the minor version if supported, otherwise -1
Throws:
DatabaseException
See Also:
AbstractDatabase.getDatabaseMinorVersion()

escapeIndexName

public String escapeIndexName(String schemaName,
                              String indexName)
Specified by:
escapeIndexName in interface Database
Overrides:
escapeIndexName in class AbstractDatabase


Copyright © 2004-2011 Liquibase.org. All Rights Reserved.