StatementType - 解析器所返回的sql语句解析结果对象类型StatementBuilderType - 解析器需要的建造者类,建造者类所建造出来的是sql语句的解析结果对象,在解析器中,使用建造者类进行不断的建造,最终返回一个结果数据对象public interface SQLParser<StatementType,StatementBuilderType extends Builder<?>>
The interface of SQL parser, the unified parent class of the parser, which provides parsing functions for SQL statements and SQL parsing words, and is implemented by different parsers.
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getName() |
StatementType |
parseSql(String sql)
开始解析一个sql语句
|
StatementType |
parseSqlByWord(StatementBuilderType StatementBuilder,
int startIndex,
String sql,
String sqlWord)
解析一个sql语句中的指定sql解析词相关的子sql语句
Parse the sub sql statements related to the specified sql parsing words in an sql statement
|
String getName()
Get the name of the parser, which is also used for the registration of the component in the manager, so you can also get the component object through the manager
StatementType parseSql(String sql)
sql - 需要被解析的sql语句StatementType parseSqlByWord(StatementBuilderType StatementBuilder, int startIndex, String sql, String sqlWord)
Parse the sub sql statements related to the specified sql parsing words in an sql statement
StatementBuilder - 累计的sql语句结果的建造类,用于结果数据对象的逐步构造。
The construction class of cumulative SQL statement results, which is used to gradually construct result data objects.
startIndex - 解析词开始出现的索引位置
Index position where the parsing word begins to appear
sql - 完整的sql语句,该语句就是需要被解析的SQL语句。
A complete SQL statement, which is the SQL statement to be parsed.
sqlWord - 需要被解析的sql解析词,利用SQL解析词确定下一层解析树需要解析的任务。
The SQL parsing words to be parsed are used to determine the tasks to be parsed in the next layer of the parse tree.
The result object of the parsed SQL statement.
Copyright © 2022. All rights reserved.