public class InsertStatement extends Statement
SQL statement object, which contains parameter information about the Insert statement in SQL.
| 限定符和类型 | 字段和说明 |
|---|---|
static short |
hashNum |
static int |
INSERT_WORD |
static int |
TABLE_WORD |
protected static Pattern |
VALUE_SPLIT_PATTERN |
static int |
VALUE_WORD |
static int |
VALUES_WORD |
COMMA_PATTERN, fieldNames, SPACE_PATTERN, tableName| 限定符 | 构造器和说明 |
|---|---|
protected |
InsertStatement(String tableName,
boolean multiline,
String fieldStr,
String dataStr) |
protected |
InsertStatement(String tableName,
boolean multiline,
String sql,
String fieldStr,
String dataStr) |
| 限定符和类型 | 方法和说明 |
|---|---|
static InsertStatementBuilder |
builder()
开始构建一个insert语句对象,通过此方法会返回一个建造者模式的对象。
|
String |
getSqlStr() |
String[] |
getStatementArrayByWord(String sqlWord)
按照SQL解析词获取到目标解析词下的sql语句
|
String |
getStatementStrByWord(String sqlWord)
按照SQL解析词获取到目标解析词下的sql语句
|
protected int |
getWordNum(String sqlWord)
获取到解析词在sql语句中的编号数值,用于将解析词按照hash与阈值一起映射成为数值后,再进行解析词的匹配,这样的匹配性能会优秀很多,其中的编号数值阈值默认为当前语句对象的hashNum。
|
InsertStatement |
merge(InsertStatement insertStatement)
以当前类为中心,将其它sql语句类中的数据合并到当前类中,并返回当前类的新副本,不会影响当前类的源数据
|
getFieldNames, getTableName, getWordNumpublic static final short hashNum
public static final int INSERT_WORD
public static final int TABLE_WORD
public static final int VALUE_WORD
public static final int VALUES_WORD
protected static final Pattern VALUE_SPLIT_PATTERN
protected InsertStatement(String tableName, boolean multiline, String sql, String fieldStr, String dataStr)
public static InsertStatementBuilder builder()
Start to build an insert statement object. This method will return an object in builder mode.
The constructor object of the insert statement
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 String getStatementStrByWord(String sqlWord)
getStatementStrByWord 在类中 StatementsqlWord - 需要获取的sql语句所属的解析词public InsertStatement merge(InsertStatement insertStatement)
insertStatement - 其它的sql语句类,也是另一方的数据来源public String[] getStatementArrayByWord(String sqlWord)
getStatementArrayByWord 在类中 StatementsqlWord - 需要获取的sql语句所属的解析词Copyright © 2022. All rights reserved.