public class

UpgradeUtils

extends Object
java.lang.Object
   ↳ com.atlassian.confluence.upgrade.UpgradeUtils

This class is deprecated.
since 3.5.9 Use HibernateDdlExecutor and associated DdlCommands, or com.atlassian.config.db.HibernateConfig if your code still needs to know which DB type its using.

Summary

Public Constructors
UpgradeUtils()
Public Methods
static void createIndex(Session session, String indexName, String tableName, String columns, Logger log)
static void dropIndex(Session session, String indexName, String tableName, Logger log)
static void executeDdl(Session session, String sql, Logger log)
static boolean getExistingBooleanValue(String key)
static int getExistingIntegerValue(String key)
static String getExistingStringValue(String key)
static Session getSession()
static boolean isDB2()
static boolean isHSQLDB()
static boolean isMSSQL()
This method is deprecated. since 3.5.8 because it is too close to isMySQL. Use isSqlServer() instead
static boolean isMySQL()
static boolean isOracle()
static boolean isSqlServer()
static boolean isSybase()
static String substituteBoolean(String sqlString)
Returns the converted SQL string with booleans converted from True or false to 1 or 0 respectively based on the isSubstituteBoolean() method that looks for databases which require the boolean values as 1 or 0.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public UpgradeUtils ()

Public Methods

public static void createIndex (Session session, String indexName, String tableName, String columns, Logger log)

Throws
HibernateException
SQLException

public static void dropIndex (Session session, String indexName, String tableName, Logger log)

Throws
HibernateException

public static void executeDdl (Session session, String sql, Logger log)

Throws
HibernateException

public static boolean getExistingBooleanValue (String key)

public static int getExistingIntegerValue (String key)

public static String getExistingStringValue (String key)

public static Session getSession ()

public static boolean isDB2 ()

public static boolean isHSQLDB ()

public static boolean isMSSQL ()

This method is deprecated.
since 3.5.8 because it is too close to isMySQL. Use isSqlServer() instead

public static boolean isMySQL ()

public static boolean isOracle ()

public static boolean isSqlServer ()

public static boolean isSybase ()

public static String substituteBoolean (String sqlString)

Returns the converted SQL string with booleans converted from True or false to 1 or 0 respectively based on the isSubstituteBoolean() method that looks for databases which require the boolean values as 1 or 0.

If the database requires does not require boolean substitution, then the original sql string will be returned unmodified.

Parameters
sqlString the raw sql query string
Returns
  • the converted sql string. (unmodified if the database supports true false boolean values).