From 704a69e1c0c3265a2b570e5b17502b26002dedd4 Mon Sep 17 00:00:00 2001
From: Lukas Eder
Date: Sat, 6 Jul 2013 13:50:56 +0200
Subject: [PATCH] [#2613] The batch INSERT query example in the manual is no
longer correct with jOOQ 3.x
---
jOOQ-website/src/main/java/Transform.java | 3 ++
.../src/main/resources/manual-3.0.xml | 46 +++++++++++--------
.../src/main/resources/manual-3.1.xml | 46 +++++++++++--------
.../src/main/resources/manual-3.2.xml | 46 +++++++++++--------
4 files changed, 84 insertions(+), 57 deletions(-)
diff --git a/jOOQ-website/src/main/java/Transform.java b/jOOQ-website/src/main/java/Transform.java
index d3095018ee..97cc180cd7 100644
--- a/jOOQ-website/src/main/java/Transform.java
+++ b/jOOQ-website/src/main/java/Transform.java
@@ -78,6 +78,9 @@ public class Transform {
private static final String version = Constants.FULL_VERSION;
public static void main(String[] args) throws Exception {
+ System.out.println("Transforming manual: " + file("manual.xml"));
+ System.out.println();
+
System.out.println("Transforming multi-page manual");
System.out.println("------------------------------");
multiplePages();
diff --git a/jOOQ-website/src/main/resources/manual-3.0.xml b/jOOQ-website/src/main/resources/manual-3.0.xml
index e797395655..d5ea427a38 100644
--- a/jOOQ-website/src/main/resources/manual-3.0.xml
+++ b/jOOQ-website/src/main/resources/manual-3.0.xml
@@ -7238,29 +7238,33 @@ finally {
@@ -7274,20 +7278,24 @@ int[] result = stmt.executeBatch();]]>
+create.batch(create.insertInto(AUTHOR, ID, FIRST_NAME, LAST_NAME).values((Integer) null, null, null))
+ .bind(1, "Erich", "Gamma")
+ .bind(2, "Richard", "Helm")
+ .bind(3, "Ralph", "Johnson")
+ .bind(4, "John", "Vlissides")
+ .execute();]]>
+
+
+ When creating a batch execution with a single query and multiple bind values, you will still have to provide jOOQ with dummy bind values for the original query. In the above example, these are set to null. For subsequent calls to bind(), there will be no type safety provided by jOOQ.
+
diff --git a/jOOQ-website/src/main/resources/manual-3.1.xml b/jOOQ-website/src/main/resources/manual-3.1.xml
index 42032c2eff..7e657f1c32 100644
--- a/jOOQ-website/src/main/resources/manual-3.1.xml
+++ b/jOOQ-website/src/main/resources/manual-3.1.xml
@@ -7596,29 +7596,33 @@ DSL.using(new DefaultConfiguration()
@@ -7632,20 +7636,24 @@ int[] result = stmt.executeBatch();]]>
+create.batch(create.insertInto(AUTHOR, ID, FIRST_NAME, LAST_NAME).values((Integer) null, null, null))
+ .bind(1, "Erich", "Gamma")
+ .bind(2, "Richard", "Helm")
+ .bind(3, "Ralph", "Johnson")
+ .bind(4, "John", "Vlissides")
+ .execute();]]>
+
+
+ When creating a batch execution with a single query and multiple bind values, you will still have to provide jOOQ with dummy bind values for the original query. In the above example, these are set to null. For subsequent calls to bind(), there will be no type safety provided by jOOQ.
+
diff --git a/jOOQ-website/src/main/resources/manual-3.2.xml b/jOOQ-website/src/main/resources/manual-3.2.xml
index 2b3529ad43..a9552a51d1 100644
--- a/jOOQ-website/src/main/resources/manual-3.2.xml
+++ b/jOOQ-website/src/main/resources/manual-3.2.xml
@@ -7592,29 +7592,33 @@ DSL.using(new DefaultConfiguration()
@@ -7628,20 +7632,24 @@ int[] result = stmt.executeBatch();]]>
+
+
+ When creating a batch execution with a single query and multiple bind values, you will still have to provide jOOQ with dummy bind values for the original query. In the above example, these are set to null. For subsequent calls to bind(), there will be no type safety provided by jOOQ.
+
@@ -8806,7 +8814,7 @@ public class PrettyPrinter extends DefaultExecuteListener {
With the above configuration, let's fetch some data with jOOQ
-create.select(BOOK.ID, BOOK.TITLE).from(BOOK).orderBy(BOOK.ID).limit(1, 2).fetch();]]>
+
The above query may result in the following log output: