it.openutils.migration.task.update
Class ScriptBasedDbUpdate

java.lang.Object
  extended by it.openutils.migration.task.update.ScriptBasedDbUpdate
All Implemented Interfaces:
DbTask, DbUpdate

public class ScriptBasedDbUpdate
extends java.lang.Object
implements DbUpdate

Version:
$Id: ScriptBasedDbUpdate.java 526 2008-01-14 12:00:28Z fgiust $
Author:
fgiust

Constructor Summary
ScriptBasedDbUpdate()
           
 
Method Summary
 void execute(javax.sql.DataSource dataSource)
          Execute this db task.
 java.lang.String getDescription()
          Returns a description for this task
 int getVersion()
          Returns the version for this update.
 void setDescription(java.lang.String description)
          Sets the description.
 void setScript(org.springframework.core.io.Resource script)
          Sets the script.
 void setVersion(int version)
          Sets the version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptBasedDbUpdate

public ScriptBasedDbUpdate()
Method Detail

setScript

public void setScript(org.springframework.core.io.Resource script)
Sets the script.

Parameters:
script - the script to set

getVersion

public int getVersion()
Returns the version for this update. THe task will be executed only if the current db version is lower than this.

Specified by:
getVersion in interface DbUpdate
Returns:
target version for this upgrade.

setVersion

public void setVersion(int version)
Sets the version.

Parameters:
version - the version to set

getDescription

public java.lang.String getDescription()
Returns a description for this task

Specified by:
getDescription in interface DbTask
Returns:
task description

setDescription

public void setDescription(java.lang.String description)
Sets the description.

Parameters:
description - the description to set

execute

public void execute(javax.sql.DataSource dataSource)
Execute this db task.

Specified by:
execute in interface DbTask
Parameters:
dataSource - javax.sql.datasource


Copyright © 2008 Openmind. All Rights Reserved.