liquibase.ext.hibernate.database
Class HibernateSpringDatabase

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

public class HibernateSpringDatabase
extends HibernateDatabase

Database implementation for "spring" hibernate configurations. This supports passing a spring XML file reference and bean name or a package containing hibernate annotated classes.


Field Summary
 
Fields inherited from class liquibase.ext.hibernate.database.HibernateDatabase
DEFAULT_SCHEMA, 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
HibernateSpringDatabase()
           
 
Method Summary
protected  org.hibernate.cfg.Configuration buildConfiguration(HibernateConnection connection)
          Concrete implementations use this method to create the hibernate Configuration object based on the passed URL
 org.hibernate.cfg.Configuration buildConfigurationFromScanning(HibernateConnection connection)
          Build hibernate configuration assuming the passed connection URL is a package to scan
protected  org.hibernate.cfg.Configuration buildConfigurationFromXml(HibernateConnection connection)
          Parse the given URL assuming it is a spring XML file
protected  String getDefaultDatabaseProductName()
           
 String getShortName()
           
 boolean isCorrectDatabaseImplementation(liquibase.database.DatabaseConnection conn)
           
protected  boolean isXmlFile(String path)
          Return true if the given path is a spring XML file.
 
Methods inherited from class liquibase.ext.hibernate.database.HibernateDatabase
afterSetup, configureDialect, configureNamingStrategy, createsIndexesForForeignKeys, getConfiguration, getConnectionCatalogName, getConnectionSchemaName, getDefaultCatalogName, getDefaultDriver, getDefaultPort, getDefaultSchemaName, getDialect, getPriority, isCaseSensitive, isSafeToRunUpdate, requiresPassword, requiresUsername, setConnection, supportsCatalogs, supportsInitiallyDeferrableColumns, supportsSchemas, 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, 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
 

Constructor Detail

HibernateSpringDatabase

public HibernateSpringDatabase()
Method Detail

isCorrectDatabaseImplementation

public boolean isCorrectDatabaseImplementation(liquibase.database.DatabaseConnection conn)
                                        throws liquibase.exception.DatabaseException
Throws:
liquibase.exception.DatabaseException

buildConfiguration

protected org.hibernate.cfg.Configuration buildConfiguration(HibernateConnection connection)
                                                      throws liquibase.exception.DatabaseException
Description copied from class: HibernateDatabase
Concrete implementations use this method to create the hibernate Configuration object based on the passed URL

Specified by:
buildConfiguration in class HibernateDatabase
Throws:
liquibase.exception.DatabaseException

isXmlFile

protected boolean isXmlFile(String path)
Return true if the given path is a spring XML file.


buildConfigurationFromXml

protected org.hibernate.cfg.Configuration buildConfigurationFromXml(HibernateConnection connection)
                                                             throws liquibase.exception.DatabaseException
Parse the given URL assuming it is a spring XML file

Throws:
liquibase.exception.DatabaseException

buildConfigurationFromScanning

public org.hibernate.cfg.Configuration buildConfigurationFromScanning(HibernateConnection connection)
Build hibernate configuration assuming the passed connection URL is a package to scan

Parameters:
connection -
Returns:

getShortName

public String getShortName()

getDefaultDatabaseProductName

protected String getDefaultDatabaseProductName()
Specified by:
getDefaultDatabaseProductName in class liquibase.database.AbstractJdbcDatabase


Copyright © 2015 Liquibase.org. All rights reserved.