format the code

This commit is contained in:
xieyinglin 2019-10-24 12:19:49 +08:00
parent 76f82481f5
commit 2add95e9fe
3 changed files with 388 additions and 376 deletions

View File

@ -33,9 +33,9 @@ public class SavedPreparedStatement {
/** /**
* insert or import sql template pattern, the template are the following: * insert or import sql template pattern, the template are the following:
* * <p>
* insert/import into tableName [(field1, field2, ...)] [using stables tags(?, ?, ...) ] values(?, ?, ...) (?, ?, ...) * insert/import into tableName [(field1, field2, ...)] [using stables tags(?, ?, ...) ] values(?, ?, ...) (?, ?, ...)
* * <p>
* we split it to three part: * we split it to three part:
* 1. prefix, insert/import * 1. prefix, insert/import
* 2. middle, tableName [(field1, field2, ...)] [using stables tags(?, ?, ...) ] * 2. middle, tableName [(field1, field2, ...)] [using stables tags(?, ?, ...) ]
@ -91,6 +91,7 @@ public class SavedPreparedStatement {
/** /**
* parse the init param according the sql param * parse the init param according the sql param
*
* @param sql * @param sql
*/ */
private void parsePreparedParam(String sql) throws SQLException { private void parsePreparedParam(String sql) throws SQLException {
@ -140,6 +141,7 @@ public class SavedPreparedStatement {
/** /**
* generate the default param value list * generate the default param value list
*
* @param paramSize * @param paramSize
* @return * @return
*/ */
@ -157,6 +159,7 @@ public class SavedPreparedStatement {
/** /**
* calculate the placeholder num * calculate the placeholder num
*
* @param value * @param value
* @return * @return
*/ */
@ -175,6 +178,7 @@ public class SavedPreparedStatement {
/** /**
* set current row params * set current row params
*
* @param parameterIndex the first parameter is 1, the second is 2, ... * @param parameterIndex the first parameter is 1, the second is 2, ...
* @param x the parameter value * @param x the parameter value
*/ */
@ -202,7 +206,7 @@ public class SavedPreparedStatement {
return; return;
} }
if (this.valueListSize != 0 && parameterIndex >= this.middleParamSize && parameterIndex < (this.middleParamSize + this.valueListSize)){ if (this.valueListSize != 0 && parameterIndex >= this.middleParamSize && parameterIndex < paramSize) {
this.initPreparedParam.setValueParam(parameterIndex - this.middleParamSize, x); this.initPreparedParam.setValueParam(parameterIndex - this.middleParamSize, x);
return; return;
@ -231,6 +235,7 @@ public class SavedPreparedStatement {
/** /**
* execute the sql with batch sql * execute the sql with batch sql
*
* @return * @return
* @throws SQLException * @throws SQLException
*/ */
@ -262,6 +267,7 @@ public class SavedPreparedStatement {
/** /**
* generate the batch sql * generate the batch sql
*
* @return * @return
*/ */
private String generateExecuteSql() { private String generateExecuteSql() {
@ -327,6 +333,7 @@ public class SavedPreparedStatement {
/** /**
* replace the middle and value part * replace the middle and value part
*
* @param tsdbPreparedParam * @param tsdbPreparedParam
* @return * @return
*/ */
@ -348,6 +355,7 @@ public class SavedPreparedStatement {
/** /**
* replace the placeholder of the template with TSDBPreparedParam list * replace the placeholder of the template with TSDBPreparedParam list
*
* @param template * @param template
* @param sqlParamList * @param sqlParamList
* @return * @return
@ -374,6 +382,7 @@ public class SavedPreparedStatement {
/** /**
* replace the placeholder of the template with paramList * replace the placeholder of the template with paramList
*
* @param template * @param template
* @param paramList * @param paramList
* @return * @return
@ -402,6 +411,7 @@ public class SavedPreparedStatement {
/** /**
* get the string of param object * get the string of param object
*
* @param paramObj * @param paramObj
* @return * @return
*/ */

View File

@ -64,6 +64,7 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
/** /**
* if the precompiled sql is insert or import * if the precompiled sql is insert or import
*
* @param sql * @param sql
* @return * @return
*/ */
@ -153,6 +154,7 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
/** /**
* Populate parameters into prepared sql statements * Populate parameters into prepared sql statements
*
* @return a string of the native sql statement for TSDB * @return a string of the native sql statement for TSDB
*/ */
private String getNativeSql() { private String getNativeSql() {