package com.legendzero.lzlib.database;

import com.legendzero.lzlib.data.SQLData;

import java.util.Iterator;
import java.util.function.Function;

public class SQLBatch<T> extends SQLStatement {

    private final Function<? super T, Object>[] mappingFunctions;

    public SQLBatch(String update, Function<? super T, Object>... mappingFunctions) {
        super(update);
        this.mappingFunctions = mappingFunctions;
    }

    public SQLBatch(SQLStatement sqlStatement, Function<? super T, Object>... mappingFunctions) {
        super(sqlStatement);
        this.mappingFunctions = mappingFunctions;
    }

    public Function<? super T, Object>[] getMappingFunctions() {
        return this.mappingFunctions;
    }

    public final int[] batch(SQLData<?> data, Iterable<T> iterable) {
        return data.batch(this, iterable);
    }

    public final int[] batch(SQLData<?> data, Iterator<T> iterator) {
        return data.batch(this, iterator);
    }

    public final int[] batch(SQLData<?> data, T... values) {
        return data.batch(this, values);
    }
}

@@ -103,16 +103,39 @@
 erator;%0A
+import java.util.List;%0A
 import j
@@ -230,16 +230,21 @@
 e final 
+List%3C
 Function
@@ -262,18 +262,17 @@
  Object%3E
-%5B%5D
+%3E
  mapping
@@ -318,16 +318,21 @@
 update, 
+List%3C
 Function
@@ -342,35 +342,33 @@
 super T, Object%3E
-...
+%3E
  mappingFunction
@@ -499,16 +499,21 @@
 tement, 
+List%3C
 Function
@@ -531,19 +531,17 @@
  Object%3E
-...
+%3E
  mapping
@@ -650,16 +650,21 @@
  public 
+List%3C
 Function
@@ -682,18 +682,17 @@
  Object%3E
-%5B%5D
+%3E
  getMapp

Use list to store functions for type safety.