Package liquibase.util
Class SqlUtil
java.lang.Object
liquibase.util.SqlUtil
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
NAME_PATTERN
-
-
Constructor Details
-
SqlUtil
public SqlUtil()
-
-
Method Details
-
isNumeric
public static boolean isNumeric(int dataType) -
isBoolean
public static boolean isBoolean(int dataType) -
isDate
public static boolean isDate(int dataType) -
parseValue
-
replacePredicatePlaceholders
-
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
-
convertSqlArrayToString
Given an array of sql, get the string sql statements.- Parameters:
sqlStatements
- the statements to stringify- Returns:
- the sql string or an empty string if there are no statements to generate
-