de.viaboxx.dbmigrate.spring
Class DBMigrateBean
java.lang.Object
de.viaboxx.dbmigrate.spring.DBMigrateBean
- All Implemented Interfaces:
- org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean
public class DBMigrateBean
- extends Object
- implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanNameAware
Description:
Bean to integrate and configure dbmigrate via spring.
Supports spring access common options of AutoMigrationTool:
- sim: simulation (false)
- migrateConfigFileName: xml setup file (migration.xml)
Currently not supported features via spring-configuration:
- script: ScriptAction
- op: OperationAction
User: roman.stumm
Date: 03.11.2011
Time: 08:06:42
viaboxx GmbH, 2011
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
beanName
protected String beanName
dataSourceConfigurator
protected de.viaboxx.dbmigrate.spring.DBCPAdapter dataSourceConfigurator
DBMigrateBean
public DBMigrateBean()
setConfigFile
public void setConfigFile(String fileName)
- Parameters:
fileName - - default is "migration.xml", see BaseMigrationTool#migrateConfigFileName
isDisabled
public boolean isDisabled()
setDisabled
public void setDisabled(boolean disabled)
isStopOnException
public boolean isStopOnException()
setStopOnException
public void setStopOnException(boolean stopOnException)
setSimulation
public void setSimulation(boolean sim)
- Parameters:
sim - - default is 'false'
setConfigRootUrl
public void setConfigRootUrl(String configRoot)
setToVersion
public void setToVersion(String version)
setFromVersion
public void setFromVersion(String version)
setEnvironment
public void setEnvironment(Map<String,Object> env)
setMigrateConfig
public void setMigrateConfig(Map<Object,Object> conf)
getTool
public AutoMigrationTool getTool()
- Returns:
- the underlying dbmigrate tool instance (never null)
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Automatically start dbmigrate. Throw exception when something goes wrong.
- Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
- Throws:
Exception - - all exceptions when dbmigrate not successful
setBeanName
public void setBeanName(String name)
- Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware
setDataSource
public void setDataSource(DataSource dataSource)
- you can optionally configure the database connection for dbmigrate by
providing a BasicDataSource. Otherwise dbmigrate uses its proprietary database connection settings.
(for proprietary configuration, see properties file configured with
<file name="JdbcConfig" file="dbconnect.properties"/>
or provide these information in the xml configuration,
read more here:
DBMigrateConfigFile
- Parameters:
dataSource -
Copyright © 2008-2012. All Rights Reserved.