diff --git a/jOOQ/src/main/java/org/jooq/BatchBindStep.java b/jOOQ/src/main/java/org/jooq/BatchBindStep.java
index 7dadef8b74..0a5ff0f01b 100644
--- a/jOOQ/src/main/java/org/jooq/BatchBindStep.java
+++ b/jOOQ/src/main/java/org/jooq/BatchBindStep.java
@@ -41,6 +41,7 @@
package org.jooq;
import java.sql.Statement;
+import java.util.Map;
/**
* This type is used for the {@link Batch}'s DSL API.
@@ -54,14 +55,56 @@ import java.sql.Statement;
public interface BatchBindStep extends Batch {
/**
- * Set bind values on the batch statement.
+ * Set indexed bind values onto the batch statement.
+ *
+ * The argument array of bindValues will be set onto the
+ * indexed bind values of the batch statement:
+ *
+ *
:1 -> bindValues[0]
+ *
:2 -> bindValues[1]
+ *
...
+ *
:N -> bindValues[N - 1]
+ *
+ *
+ * "Unmatched" bind values will be left unmodified:
+ *
+ *
:N+1 -> unmodified
+ *
:N+2 -> unmodified
+ *
*/
BatchBindStep bind(Object... bindValues);
/**
- * Set several bind values on the batch statement.
+ * Set several indexed bind values onto the batch statement.
*
* This is the same as calling {@link #bind(Object...)} several times.
*/
- BatchBindStep bind(Object[][] bindValues);
+ BatchBindStep bind(Object[]... bindValues);
+
+ /**
+ * Set named bind values onto the batch statement.
+ *
+ * The argument map of namedBindValues will be set onto the
+ * named bind values of the batch statement:
+ *
+ *
:name1 -> bindValues.get("name1")
+ *
:name2 -> bindValues.get("name2")
+ *
...
+ *
:nameN -> bindValues.get("nameN")
+ *
+ *
+ * "Unmatched" bind values will be left unmodified:
+ *
+ *
:nameN+1 -> unmodified
+ *
:nameN+2 -> unmodified
+ *
+ */
+ BatchBindStep bind(Map namedBindValues);
+
+ /**
+ * Set several named bind values onto the batch statement.
+ *
+ * This is the same as calling {@link #bind(Map...)} several times.
+ */
+ BatchBindStep bind(Map... namedBindValues);
}
diff --git a/jOOQ/src/main/java/org/jooq/impl/BatchSingle.java b/jOOQ/src/main/java/org/jooq/impl/BatchSingle.java
index d8e543f140..3d7891bbe5 100644
--- a/jOOQ/src/main/java/org/jooq/impl/BatchSingle.java
+++ b/jOOQ/src/main/java/org/jooq/impl/BatchSingle.java
@@ -49,7 +49,10 @@ import static org.jooq.impl.Utils.visitAll;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
import org.jooq.BatchBindStep;
import org.jooq.Configuration;
@@ -58,6 +61,7 @@ import org.jooq.DataType;
import org.jooq.ExecuteContext;
import org.jooq.ExecuteListener;
import org.jooq.Field;
+import org.jooq.Param;
import org.jooq.Query;
import org.jooq.exception.ControlFlowSignal;
@@ -69,18 +73,32 @@ class BatchSingle implements BatchBindStep {
/**
* Generated UID
*/
- private static final long serialVersionUID = 3793967258181493207L;
+ private static final long serialVersionUID = 3793967258181493207L;
- private final DSLContext create;
- private final Configuration configuration;
- private final Query query;
- private final List