com.atlassian.confluence.upgrade.upgradetask
Class AbstractConstraintCreationUpgradeTask

java.lang.Object
  extended by com.atlassian.confluence.upgrade.AbstractUpgradeTask
      extended by com.atlassian.confluence.upgrade.upgradetask.AbstractConstraintCreationUpgradeTask
All Implemented Interfaces:
DatabaseUpgradeTask, UpgradeTask
Direct Known Subclasses:
EmbeddedCrowdSchemaUpgradeTask

public abstract class AbstractConstraintCreationUpgradeTask
extends AbstractUpgradeTask
implements DatabaseUpgradeTask

An abstract upgrade task for when you just want to run a bunch of constraint creation statements from a properties file.


Field Summary
static org.slf4j.Logger log
           
protected  net.sf.hibernate.SessionFactory sessionFactory
           
 
Constructor Summary
AbstractConstraintCreationUpgradeTask(net.sf.hibernate.SessionFactory sessionFactory)
           
 
Method Summary
protected abstract  void doBeforeUpgrade(net.sf.hibernate.Session session, org.springframework.jdbc.core.JdbcTemplate template)
           
 void doUpgrade()
          Perform the upgrade.
protected abstract  List<String> getSqlStatementsFromPropertiesFile()
           
protected static List<String> getSqlStatementsFromPropertiesFile(String propertiesFile)
           
static boolean uniqueAllowsMultipleNullValues()
           
 
Methods inherited from class com.atlassian.confluence.upgrade.AbstractUpgradeTask
addAllErrors, addError, addError, getBuildNumber, getConstraint, getErrors, getShortDescription, setBuildNumber, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.upgrade.UpgradeTask
getBuildNumber, getConstraint, getErrors, getShortDescription, validate
 

Field Detail

log

public static final org.slf4j.Logger log

sessionFactory

protected final net.sf.hibernate.SessionFactory sessionFactory
Constructor Detail

AbstractConstraintCreationUpgradeTask

public AbstractConstraintCreationUpgradeTask(net.sf.hibernate.SessionFactory sessionFactory)
Method Detail

getSqlStatementsFromPropertiesFile

protected abstract List<String> getSqlStatementsFromPropertiesFile()

getSqlStatementsFromPropertiesFile

protected static List<String> getSqlStatementsFromPropertiesFile(String propertiesFile)

doBeforeUpgrade

protected abstract void doBeforeUpgrade(net.sf.hibernate.Session session,
                                        org.springframework.jdbc.core.JdbcTemplate template)

doUpgrade

public final void doUpgrade()
                     throws Exception
Description copied from interface: UpgradeTask
Perform the upgrade.

Specified by:
doUpgrade in interface UpgradeTask
Throws:
Exception
See Also:
doUpgrade(JdbcTemplate)

uniqueAllowsMultipleNullValues

public static boolean uniqueAllowsMultipleNullValues()
Returns:
True if the current database allows multiple null values to be inserted in a column on which there is a unique constraint.


Copyright © 2003-2012 Atlassian. All Rights Reserved.