com.atlassian.bamboo.upgrade.tasks
Class AbstractStatementUpgradeTask

java.lang.Object
  extended by com.atlassian.bamboo.upgrade.AbstractUpgradeTask
      extended by com.atlassian.bamboo.upgrade.tasks.AbstractInHibernateTransactionUpgradeTask
          extended by com.atlassian.bamboo.upgrade.tasks.AbstractStatementUpgradeTask
All Implemented Interfaces:
UpgradeTask
Direct Known Subclasses:
UpgradeTask1831FixNullBuildCompleted, UpgradeTask802CommitMsgFieldToClob

public abstract class AbstractStatementUpgradeTask
extends AbstractInHibernateTransactionUpgradeTask

A base upgrade task for SQL to be run on a series of Statement


Field Summary
 
Fields inherited from class com.atlassian.bamboo.upgrade.AbstractUpgradeTask
errors
 
Constructor Summary
protected AbstractStatementUpgradeTask(java.lang.String buildNumber, java.lang.String shortDescription)
           
 
Method Summary
 void doUpgrade(java.sql.Connection connection)
           
protected abstract  java.util.List<java.lang.String> getSqlStatements()
          A list of SQL statements to be run in order.
protected abstract  boolean isShouldRunUpgrade(java.sql.Statement statement)
          Whether or not the upgrade task should actually run
 
Methods inherited from class com.atlassian.bamboo.upgrade.tasks.AbstractInHibernateTransactionUpgradeTask
doUpgrade, setBambooConnectionTemplate
 
Methods inherited from class com.atlassian.bamboo.upgrade.AbstractUpgradeTask
getBuildNumber, getErrors, getShortDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStatementUpgradeTask

protected AbstractStatementUpgradeTask(@NotNull
                                       java.lang.String buildNumber,
                                       @NotNull
                                       java.lang.String shortDescription)
Method Detail

doUpgrade

public void doUpgrade(@NotNull
                      java.sql.Connection connection)
               throws java.sql.SQLException
Specified by:
doUpgrade in class AbstractInHibernateTransactionUpgradeTask
Throws:
java.sql.SQLException

isShouldRunUpgrade

protected abstract boolean isShouldRunUpgrade(@NotNull
                                              java.sql.Statement statement)
Whether or not the upgrade task should actually run

Parameters:
statement -
Returns:

getSqlStatements

protected abstract java.util.List<java.lang.String> getSqlStatements()
A list of SQL statements to be run in order. Execution will stop

Returns:


Copyright © 2010 Atlassian. All Rights Reserved.