public class

UpgradeUtils

extends Object
java.lang.Object
   ↳ com.atlassian.jira.upgrade.util.UpgradeUtils

Summary

Public Constructors
UpgradeUtils(OfBizDelegator delegator)
Public Methods
void clearColumn(String tableName, String column)
static void doColumnsOrTablesExist(List<TableColumnCheckResult> tableColumnCheckResults)
static String getExactColumnName(String tableName, String columnName)
Returns the exact column name according to the database.
static String getExactTableName(String entityName)
static int getJIRABuildVersionNumber()
This will return the current build version of JIRA present in the database.
static boolean tableExists(String tableName)
This method is used to verify if a named table exists or not within the database.
void transformTableColumn(String tableName, String sourceColumn, String targetColumn, Transformer transformer)
Transform a column in a table into another column on that same table.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public UpgradeUtils (OfBizDelegator delegator)

Public Methods

public void clearColumn (String tableName, String column)

public static void doColumnsOrTablesExist (List<TableColumnCheckResult> tableColumnCheckResults)

public static String getExactColumnName (String tableName, 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.

public static String getExactTableName (String entityName)

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

public static boolean tableExists (String tableName)

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

public void transformTableColumn (String tableName, String sourceColumn, String targetColumn, 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 @Nonnull
sourceColumn name of source column @Nonnull
targetColumn name of target columns @Nonnull
transformer the transformer used to transform the column