liquibase.ext.hibernate.database
Class HibernateDatabase

java.lang.Object
  extended by liquibase.database.AbstractJdbcDatabase
      extended by liquibase.ext.hibernate.database.HibernateDatabase
All Implemented Interfaces:
liquibase.database.Database, liquibase.servicelocator.PrioritizedService
Direct Known Subclasses:
HibernateClassicDatabase, HibernateEjb3Database, HibernateSpringDatabase

public abstract class HibernateDatabase
extends liquibase.database.AbstractJdbcDatabase

Base class for all Hibernate Databases. This extension interacts with Hibernate by creating standard liquibase.database.Database implementations that bridge what Liquibase expects and the Hibernate APIs.


Field Summary
static String DEFAULT_SCHEMA
           
protected static liquibase.logging.Logger LOG
           
 
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
HibernateDatabase()
           
 
Method Summary
protected  void afterSetup()
          Perform any post-configuration setting logic.
protected abstract  org.hibernate.cfg.Configuration buildConfiguration(HibernateConnection conn)
          Concrete implementations use this method to create the hibernate Configuration object based on the passed URL
protected  org.hibernate.dialect.Dialect configureDialect()
          Return the dialect used by hibernate
protected  void configureNamingStrategy(org.hibernate.cfg.Configuration configuration, HibernateConnection connection)
          Configures the naming strategy use by the connection
 boolean createsIndexesForForeignKeys()
           
 org.hibernate.cfg.Configuration getConfiguration()
           
protected  String getConnectionCatalogName()
           
protected  String getConnectionSchemaName()
           
 String getDefaultCatalogName()
           
 String getDefaultDriver(String url)
           
 Integer getDefaultPort()
           
 String getDefaultSchemaName()
           
 org.hibernate.dialect.Dialect getDialect()
           
 int getPriority()
           
 boolean isCaseSensitive()
           
 boolean isSafeToRunUpdate()
           
 boolean requiresPassword()
           
 boolean requiresUsername()
           
 void setConnection(liquibase.database.DatabaseConnection conn)
           
 boolean supportsCatalogs()
           
 boolean supportsInitiallyDeferrableColumns()
           
 boolean supportsSchemas()
           
 boolean supportsTablespaces()
           
 
Methods inherited from class liquibase.database.AbstractJdbcDatabase
addReservedWords, canCreateChangeLogTable, close, commit, correctObjectName, correctSchema, correctSchema, dataTypeIsNotModifiable, disableForeignKeyChecks, doesTagExist, dropDatabaseObjects, enableForeignKeyChecks, equals, escapeColumnName, escapeColumnName, escapeColumnNameList, escapeConstraintName, escapeIndexName, escapeObjectName, escapeObjectName, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeRollbackStatements, executeStatements, filterRollbackVisitors, generateAutoIncrementBy, generateAutoIncrementStartWith, generateDatabaseFunctionValue, generatePrimaryKeyName, getAutoCommitMode, getAutoIncrementByClause, getAutoIncrementClause, getAutoIncrementClause, getAutoIncrementClosing, getAutoIncrementOpening, getAutoIncrementStartWithClause, getConcatSql, getConnection, getContainingObjects, getCurrentDateTimeFunction, getDatabaseChangeLogLockTableName, getDatabaseChangeLogTableName, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductVersion, getDataTypeMaxParameters, getDateFunctions, getDateLiteral, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultDatabaseProductName, getDefaultSchema, getJdbcCatalogName, getJdbcCatalogName, getJdbcSchemaName, getJdbcSchemaName, getLineComment, getLiquibaseCatalogName, getLiquibaseSchemaName, getLiquibaseTablespaceName, getName, getObjectQuotingStrategy, getOutputDefaultCatalog, getOutputDefaultSchema, getRanChangeSet, getRanChangeSetList, getRanDate, getRunStatus, getSchemaFromJdbcInfo, getSystemSchema, getSystemTables, getSystemViews, getTimeLiteral, getViewDefinition, hashCode, isAutoCommit, isDateOnly, isDateTime, isDefaultCatalog, isDefaultSchema, isFunction, isLiquibaseObject, isReservedWord, isSystemObject, isSystemView, isTimeOnly, jdbcCallsCatalogsSchemas, markChangeSetExecStatus, mustQuoteObjectName, parseDate, quoteObject, removeRanStatus, resetInternalState, rollback, saveRollbackStatement, saveStatements, setAutoCommit, setCanCacheLiquibaseTableInfo, setCaseSensitive, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultCatalogName, setDefaultSchemaName, setLiquibaseCatalogName, setLiquibaseSchemaName, setLiquibaseTablespaceName, setObjectQuotingStrategy, setOutputDefaultCatalog, setOutputDefaultSchema, startsWithNumeric, supportsAutoIncrement, supportsCatalogInObjectName, supportsDDLInTransaction, supportsDropTableCascadeConstraints, supportsForeignKeyDisable, supportsPrimaryKeyNames, supportsRestrictForeignKeys, supportsSequences, tag, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface liquibase.database.Database
getShortName, isCorrectDatabaseImplementation
 

Field Detail

LOG

protected static final liquibase.logging.Logger LOG

DEFAULT_SCHEMA

public static final String DEFAULT_SCHEMA
See Also:
Constant Field Values
Constructor Detail

HibernateDatabase

public HibernateDatabase()
Method Detail

setConnection

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

configureDialect

protected org.hibernate.dialect.Dialect configureDialect()
                                                  throws liquibase.exception.DatabaseException
Return the dialect used by hibernate

Throws:
liquibase.exception.DatabaseException

configureNamingStrategy

protected void configureNamingStrategy(org.hibernate.cfg.Configuration configuration,
                                       HibernateConnection connection)
Configures the naming strategy use by the connection

Parameters:
configuration - the Configuration
connection - the HibernateConnection

afterSetup

protected void afterSetup()
Perform any post-configuration setting logic.


buildConfiguration

protected abstract org.hibernate.cfg.Configuration buildConfiguration(HibernateConnection conn)
                                                               throws liquibase.exception.DatabaseException
Concrete implementations use this method to create the hibernate Configuration object based on the passed URL

Throws:
liquibase.exception.DatabaseException

requiresPassword

public boolean requiresPassword()
Specified by:
requiresPassword in interface liquibase.database.Database
Overrides:
requiresPassword in class liquibase.database.AbstractJdbcDatabase

requiresUsername

public boolean requiresUsername()
Specified by:
requiresUsername in interface liquibase.database.Database
Overrides:
requiresUsername in class liquibase.database.AbstractJdbcDatabase

getDefaultDriver

public String getDefaultDriver(String url)

getPriority

public int getPriority()

createsIndexesForForeignKeys

public boolean createsIndexesForForeignKeys()
Specified by:
createsIndexesForForeignKeys in interface liquibase.database.Database
Overrides:
createsIndexesForForeignKeys in class liquibase.database.AbstractJdbcDatabase

getDefaultPort

public Integer getDefaultPort()

supportsInitiallyDeferrableColumns

public boolean supportsInitiallyDeferrableColumns()

supportsTablespaces

public boolean supportsTablespaces()

getConfiguration

public org.hibernate.cfg.Configuration getConfiguration()
                                                 throws liquibase.exception.DatabaseException
Throws:
liquibase.exception.DatabaseException

getDialect

public org.hibernate.dialect.Dialect getDialect()
                                         throws liquibase.exception.DatabaseException
Throws:
liquibase.exception.DatabaseException

getConnectionCatalogName

protected String getConnectionCatalogName()
                                   throws liquibase.exception.DatabaseException
Overrides:
getConnectionCatalogName in class liquibase.database.AbstractJdbcDatabase
Throws:
liquibase.exception.DatabaseException

getConnectionSchemaName

protected String getConnectionSchemaName()
Overrides:
getConnectionSchemaName in class liquibase.database.AbstractJdbcDatabase

getDefaultSchemaName

public String getDefaultSchemaName()
Specified by:
getDefaultSchemaName in interface liquibase.database.Database
Overrides:
getDefaultSchemaName in class liquibase.database.AbstractJdbcDatabase

getDefaultCatalogName

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

isSafeToRunUpdate

public boolean isSafeToRunUpdate()
                          throws liquibase.exception.DatabaseException
Specified by:
isSafeToRunUpdate in interface liquibase.database.Database
Overrides:
isSafeToRunUpdate in class liquibase.database.AbstractJdbcDatabase
Throws:
liquibase.exception.DatabaseException

isCaseSensitive

public boolean isCaseSensitive()
Specified by:
isCaseSensitive in interface liquibase.database.Database
Overrides:
isCaseSensitive in class liquibase.database.AbstractJdbcDatabase

supportsSchemas

public boolean supportsSchemas()
Specified by:
supportsSchemas in interface liquibase.database.Database
Overrides:
supportsSchemas in class liquibase.database.AbstractJdbcDatabase

supportsCatalogs

public boolean supportsCatalogs()
Specified by:
supportsCatalogs in interface liquibase.database.Database
Overrides:
supportsCatalogs in class liquibase.database.AbstractJdbcDatabase


Copyright © 2015 Liquibase.org. All rights reserved.