public class CreateStatement extends Statement
SQL statement object, which contains parameter information about the create statement in SQL.
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
AS_WORD |
static int |
CREATE_WORD |
static int |
FIELD_WORD |
static short |
hashNum |
static int |
LEFT_BRACKET_WORD |
static int |
LIKE_WORD |
static int |
OPTION_WORD |
static int |
RIGHT_BRACKET_WORD |
static int |
TABLE_WORD |
COMMA_PATTERN, fieldNames, SPACE_PATTERN, tableName| 限定符 | 构造器和说明 |
|---|---|
protected |
CreateStatement(String tableName,
String createStr,
String fieldStr,
String optionsStr,
boolean temporary,
String likeStr,
SelectStatement selectStatement) |
protected |
CreateStatement(String tableName,
String sql,
String createStr,
String fieldStr,
String optionsStr,
boolean temporary,
String likeStr,
SelectStatement selectStatement) |
| 限定符和类型 | 方法和说明 |
|---|---|
static CreateStatementBuilder |
builder()
开始构建语句类对象,调用该方法也就意味着开始该类的建造,会返回对应的建造者对象。
|
SelectStatement |
getSelectStatement()
如果在create语句中,引用了其它数据表的查询结果,那么该函数可以返回create语句的子查询语句对象。
|
String |
getSqlStr() |
String[] |
getStatementArrayByWord(String sqlWord)
按照SQL解析词获取到目标解析词下的sql语句的数组形式
|
String |
getStatementStrByWord(String sqlWord)
按照SQL解析词获取到目标解析词下的sql语句
|
protected int |
getWordNum(String sqlWord)
获取到解析词在sql语句中的编号数值,用于将解析词按照hash与阈值一起映射成为数值后,再进行解析词的匹配,这样的匹配性能会优秀很多,其中的编号数值阈值默认为当前语句对象的hashNum。
|
boolean |
isTemporary() |
CreateStatement |
merge(CreateStatement createStatement)
以当前类为中心,将其它sql语句类中的数据合并到当前类中,并返回当前类的新副本,不会影响当前类的源数据
|
String |
toString() |
getFieldNames, getTableName, getWordNumpublic static final short hashNum
public static final int CREATE_WORD
public static final int TABLE_WORD
public static final int FIELD_WORD
public static final int OPTION_WORD
public static final int LEFT_BRACKET_WORD
public static final int RIGHT_BRACKET_WORD
public static final int LIKE_WORD
public static final int AS_WORD
protected CreateStatement(String tableName, String sql, String createStr, String fieldStr, String optionsStr, boolean temporary, String likeStr, SelectStatement selectStatement)
public static CreateStatementBuilder builder()
Start building statement class objects. Calling this method means starting the construction of this class, and the corresponding constructor object will be returned.
Generally speaking, if you do not extend the parser, the method will be called by the parser and the construction result will be returned to you.
protected int getWordNum(String sqlWord)
Get the number value of the parsed word in the sql statement, which is used to map the parsed word into a number by hash and threshold value, and then match the parsed word. The matching performance will be much better. The number value threshold value is the hashNum of the current statement object by default.
getWordNum 在类中 StatementsqlWord - 需要被转换的sql词public boolean isTemporary()
If true is returned, it represents the creation of a temporary table. If false is returned, it represents the creation of a common table.
public String getStatementStrByWord(String sqlWord)
getStatementStrByWord 在类中 StatementsqlWord - 需要获取的sql语句所属的解析词public String[] getStatementArrayByWord(String sqlWord)
getStatementArrayByWord 在类中 StatementsqlWord - 需要获取的sql语句所属的解析词public SelectStatement getSelectStatement()
If the query results of other data tables are referenced in the "create" statement, this function can return the sub query statement object of the "create" statement.
If there is no reference to the subQuery statement object in the "create" statement, null is returned here;
public CreateStatement merge(CreateStatement createStatement)
createStatement - 其它的sql语句类,也是另一方的数据来源Copyright © 2023. All rights reserved.