@@ -78,10 +78,9 @@ public T INTO_COLUMNS(String... columns) {
7878 * @since 3.4.2
7979 */
8080 public T INTO_VALUES (String ... values ) {
81- List <List <String >> list = sql ().values ;
82- int index = list .size () - 1 ;
81+ List <String > list = sql ().valueList .get (sql ().valueList .size () - 1 );
8382 for (String value : values ) {
84- list .get ( index ). add (value );
83+ list .add (value );
8584 }
8685 return getSelf ();
8786 }
@@ -266,8 +265,13 @@ public T ORDER_BY(String... columns) {
266265 return getSelf ();
267266 }
268267
268+ /**
269+ * @Since 3.5.2
270+ * used to add a new inserted row while
271+ * do multi-row insert
272+ */
269273 public T ADD_ROW () {
270- sql ().values .add (new ArrayList <>());
274+ sql ().valueList .add (new ArrayList <>());
271275 return getSelf ();
272276 }
273277
@@ -335,12 +339,12 @@ public enum StatementType {
335339 List <String > orderBy = new ArrayList <String >();
336340 List <String > lastList = new ArrayList <String >();
337341 List <String > columns = new ArrayList <String >();
338- List <List <String >> values = new ArrayList <>();
342+ List <List <String >> valueList = new ArrayList <>();
339343 boolean distinct ;
340344
341345 public SQLStatement () {
342346 // Prevent Synthetic Access
343- values .add (new ArrayList <>());
347+ valueList .add (new ArrayList <>());
344348 }
345349
346350 private void sqlClause (SafeAppendable builder , String keyword , List <String > parts , String open , String close ,
@@ -392,8 +396,8 @@ private void joins(SafeAppendable builder) {
392396 private String insertSQL (SafeAppendable builder ) {
393397 sqlClause (builder , "INSERT INTO" , tables , "" , "" , "" );
394398 sqlClause (builder , "" , columns , "(" , ")" , ", " );
395- for (int i = 0 ; i < values .size (); i ++) {
396- sqlClause (builder , i > 0 ? "," : "VALUES" , values .get (i ), "(" , ")" , ", " );
399+ for (int i = 0 ; i < valueList .size (); i ++) {
400+ sqlClause (builder , i > 0 ? "," : "VALUES" , valueList .get (i ), "(" , ")" , ", " );
397401 }
398402 return builder .toString ();
399403 }
0 commit comments