Package liquibase.util
Class SqlUtil
- java.lang.Object
-
- liquibase.util.SqlUtil
-
public abstract class SqlUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
NAME_PATTERN
-
Constructor Summary
Constructors Constructor Description SqlUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
convertSqlArrayToString(Sql[] sqlStatements)
Given an array of sql, get the string sql statements.static String
getSqlString(SqlStatement statement, SqlGeneratorFactory sqlGeneratorFactory, Database database)
Get the string sql statements from a given SqlStatementstatic boolean
isBoolean(int dataType)
static boolean
isDate(int dataType)
static boolean
isNumeric(int dataType)
static Object
parseValue(Database database, Object val, DataType type)
static String
replacePredicatePlaceholders(Database database, String predicate, List<String> columnNames, List<Object> parameters)
-
-
-
Field Detail
-
NAME_PATTERN
public static final Pattern NAME_PATTERN
-
-
Method Detail
-
isNumeric
public static boolean isNumeric(int dataType)
-
isBoolean
public static boolean isBoolean(int dataType)
-
isDate
public static boolean isDate(int dataType)
-
replacePredicatePlaceholders
public static String replacePredicatePlaceholders(Database database, String predicate, List<String> columnNames, List<Object> parameters)
-
getSqlString
public static String getSqlString(SqlStatement statement, SqlGeneratorFactory sqlGeneratorFactory, Database database)
Get the string sql statements from a given SqlStatement- Parameters:
statement
- the statement to stringifysqlGeneratorFactory
- the SqlGeneratorFactory instance to use to generate the sqldatabase
- the database to generate sql against- Returns:
- the sql string or an empty string if there are no statements to generate
-
-