com.atlassian.jira.upgrade.util
Class UpgradeUtils

java.lang.Object
  extended by com.atlassian.jira.upgrade.util.UpgradeUtils

public class UpgradeUtils
extends java.lang.Object


Field Summary
static java.lang.String DELEGATOR_NAME
           
static java.lang.String OFBIZ_DEFAULT_DS
           
 
Constructor Summary
UpgradeUtils(OfBizDelegator delegator)
           
 
Method Summary
 void clearColumn(java.lang.String tableName, java.lang.String column)
           
static void doColumnsOrTablesExist(java.util.List<TableColumnCheckResult> tableColumnCheckResults)
           
static java.lang.String getExactColumnName(java.lang.String tableName, java.lang.String columnName)
          Returns the exact column name according to the database.
static java.lang.String getExactTableName(java.lang.String entityName)
           
static int getJIRABuildVersionNumber()
          This will return the current build version of JIRA present in the database.
static boolean tableExists(java.lang.String tableName)
          This method is used to verify if a named table exists or not within the database.
 void transformTableColumn(java.lang.String tableName, java.lang.String sourceColumn, java.lang.String targetColumn, org.apache.commons.collections.Transformer transformer)
          Transform a column in a table into another column on that same table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OFBIZ_DEFAULT_DS

public static final java.lang.String OFBIZ_DEFAULT_DS
See Also:
Constant Field Values

DELEGATOR_NAME

public static final java.lang.String DELEGATOR_NAME
See Also:
Constant Field Values
Constructor Detail

UpgradeUtils

public UpgradeUtils(OfBizDelegator delegator)
Method Detail

transformTableColumn

public void transformTableColumn(java.lang.String tableName,
                                 java.lang.String sourceColumn,
                                 java.lang.String targetColumn,
                                 org.apache.commons.collections.Transformer transformer)
Transform a column in a table into another column on that same table. If the source object is null, then the target field will not be set

Parameters:
tableName - name of table @NotNull
sourceColumn - name of source column @NotNull
targetColumn - name of target columns @NotNull
transformer - the transformer used to transform the column

clearColumn

public void clearColumn(java.lang.String tableName,
                        java.lang.String column)

tableExists

public static boolean tableExists(java.lang.String tableName)
                           throws DataAccessException
This method is used to verify if a named table exists or not within the database.

Parameters:
tableName - is the name of the table to look for.
Returns:
true if the table, exists false otherwise.
Throws:
DataAccessException - If there is an error getting a DB connection, or getting the DB meta data

getExactColumnName

public static java.lang.String getExactColumnName(java.lang.String tableName,
                                                  java.lang.String columnName)
Returns the exact column name according to the database. This is found by case insensitively looking for the given column on the given table.

Parameters:
tableName - Table name
columnName - Column name
Returns:
the exact column name or null if it doesn't exist.

getExactTableName

public static java.lang.String getExactTableName(java.lang.String entityName)

getJIRABuildVersionNumber

public static int getJIRABuildVersionNumber()
This will return the current build version of JIRA present in the database. If JIRA has not been setup then 0 (zero) will be returned as the currnet build number.

Returns:
int the current build version of JIRA

doColumnsOrTablesExist

public static void doColumnsOrTablesExist(java.util.List<TableColumnCheckResult> tableColumnCheckResults)


Copyright © 2002-2010 Atlassian. All Rights Reserved.