public final class SQLUtil extends Object
| 构造器和说明 |
|---|
SQLUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
convertLikePatternToRegex(String pattern)
Convert like pattern to regex.
|
static ExpressionSegment |
createLiteralExpression(ASTNode astNode,
int startIndex,
int stopIndex,
String text)
Create literal expression.
|
static String |
getExactlyExpression(String value)
Get exactly SQL expression.
|
static Number |
getExactlyNumber(String value,
int radix)
Get exactly number value and type.
|
static String |
getExactlyValue(String value)
Get exactly value for SQL expression.
|
static String |
getExactlyValue(String value,
String reservedCharacters)
Get exactly value for SQL expression.
|
static String |
getExpressionWithoutOutsideParentheses(String value)
Get exactly SQL expression without outside parentheses.
|
static List<SubqueryTableSegment> |
getSubqueryTableSegmentFromTableSegment(TableSegment tableSegment)
Get subquery from tableSegment.
|
static boolean |
isReadOnly(SQLStatement sqlStatement)
Determine whether SQL is read-only.
|
static String |
trimComment(String sql)
Trim the comment of SQL.
|
static String |
trimSemicolon(String sql)
Trim the semicolon of SQL.
|
public static Number getExactlyNumber(String value, int radix)
value - string to be convertedradix - radixpublic static String getExactlyValue(String value)
remove special char for SQL expression
value - SQL expressionpublic static String getExactlyValue(String value, String reservedCharacters)
remove special char for SQL expression
value - SQL expressionreservedCharacters - characters to be reservedpublic static String getExactlyExpression(String value)
remove space for SQL expression
value - SQL expressionpublic static String getExpressionWithoutOutsideParentheses(String value)
value - SQL expressionpublic static List<SubqueryTableSegment> getSubqueryTableSegmentFromTableSegment(TableSegment tableSegment)
tableSegment - TableSegmentpublic static boolean isReadOnly(SQLStatement sqlStatement)
sqlStatement - SQL statementpublic static ExpressionSegment createLiteralExpression(ASTNode astNode, int startIndex, int stopIndex, String text)
astNode - AST nodestartIndex - start indexstopIndex - stop indextext - textpublic static String trimSemicolon(String sql)
sql - SQL to be trimpublic static String trimComment(String sql)
sql - SQL to be trimCopyright © 2022 The Apache Software Foundation. All rights reserved.