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 PatternNAME_PATTERN
-
Constructor Summary
Constructors Constructor Description SqlUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringconvertSqlArrayToString(Sql[] sqlStatements)Given an array of sql, get the string sql statements.static StringgetSqlString(SqlStatement statement, SqlGeneratorFactory sqlGeneratorFactory, Database database)Get the string sql statements from a given SqlStatementstatic booleanisBoolean(int dataType)static booleanisDate(int dataType)static booleanisNumeric(int dataType)static ObjectparseValue(Database database, Object val, DataType type)static StringreplacePredicatePlaceholders(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
-
-