|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectliquibase.integration.spring.SpringLiquibase
public class SpringLiquibase
A Spring-ified wrapper for Liquibase. Example Configuration:
This Spring configuration example will cause liquibase to run
automatically when the Spring context is initialized. It will load
db-changelog.xml
from the classpath and apply it against
myDataSource
.
<bean id="myLiquibase" class="liquibase.spring.SpringLiquibase" > <property name="dataSource" ref="myDataSource" /> <property name="changeLog" value="classpath:db-changelog.xml" /> <!-- The following configuration options are optional --> <property name="executeEnabled" value="true" /> <!-- If set to true, writeSqlFileEnabled will write the generated SQL to a file before executing it. --> <property name="writeSqlFileEnabled" value="true" /> <!-- sqlOutputDir specifies the directory into which the SQL file will be written, if so configured. --> <property name="sqlOutputDir" value="c:\sql" /> </bean>
Nested Class Summary | |
---|---|
class |
SpringLiquibase.SpringResourceOpener
|
Constructor Summary | |
---|---|
SpringLiquibase()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Executed automatically when the bean is initialized. |
protected Database |
createDatabase(java.sql.Connection c)
Subclasses may override this method add change some database settings such as default schema before returning the database object. |
protected Liquibase |
createLiquibase(java.sql.Connection c)
|
protected SpringLiquibase.SpringResourceOpener |
createResourceOpener()
Create a new resourceOpener. |
java.lang.String |
getBeanName()
Gets the Spring-name of this instance. |
java.lang.String |
getChangeLog()
Returns a Resource that is able to resolve to a file or classpath resource. |
java.lang.String |
getContexts()
|
java.lang.String |
getDatabaseProductName()
|
javax.sql.DataSource |
getDataSource()
The DataSource that liquibase will use to perform the migration. |
org.springframework.core.io.ResourceLoader |
getResourceLoader()
|
void |
setBeanName(java.lang.String name)
Spring sets this automatically to the instance's configured bean name. |
void |
setChangeLog(java.lang.String dataModel)
Sets a Spring Resource that is able to resolve to a file or classpath resource. |
void |
setContexts(java.lang.String contexts)
|
void |
setDataSource(javax.sql.DataSource dataSource)
The DataSource that liquibase will use to perform the migration. |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SpringLiquibase()
Method Detail |
---|
public java.lang.String getDatabaseProductName() throws DatabaseException
DatabaseException
public javax.sql.DataSource getDataSource()
public void setDataSource(javax.sql.DataSource dataSource)
public java.lang.String getChangeLog()
public void setChangeLog(java.lang.String dataModel)
classpath:db-changelog.xml
.
public java.lang.String getContexts()
public void setContexts(java.lang.String contexts)
public void afterPropertiesSet() throws LiquibaseException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
LiquibaseException
protected Liquibase createLiquibase(java.sql.Connection c) throws LiquibaseException
LiquibaseException
protected Database createDatabase(java.sql.Connection c) throws DatabaseException
c
-
DatabaseFactory
.
DatabaseException
protected SpringLiquibase.SpringResourceOpener createResourceOpener()
public void setBeanName(java.lang.String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public java.lang.String getBeanName()
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader
in interface org.springframework.context.ResourceLoaderAware
public org.springframework.core.io.ResourceLoader getResourceLoader()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |