From d4da8c72b0efb994e914021fc5d8e4b4f327f006 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Thu, 20 Dec 2012 13:42:40 +0100 Subject: [PATCH] [#2028] Add Batch.size() to indicate the number of queries that will be executed by a batch operation --- .../jooq/test/_/testcases/GeneralTests.java | 29 ++++++++++++------- jOOQ/src/main/java/org/jooq/Batch.java | 5 ++++ .../java/org/jooq/impl/BatchMultiple.java | 5 ++++ .../main/java/org/jooq/impl/BatchSingle.java | 5 ++++ .../main/java/org/jooq/impl/BatchStore.java | 7 ++++- 5 files changed, 40 insertions(+), 11 deletions(-) diff --git a/jOOQ-test/src/org/jooq/test/_/testcases/GeneralTests.java b/jOOQ-test/src/org/jooq/test/_/testcases/GeneralTests.java index 5cea445c1c..3b4c3a8506 100644 --- a/jOOQ-test/src/org/jooq/test/_/testcases/GeneralTests.java +++ b/jOOQ-test/src/org/jooq/test/_/testcases/GeneralTests.java @@ -61,6 +61,7 @@ import java.sql.Connection; import java.sql.Date; import java.util.Arrays; +import org.jooq.Batch; import org.jooq.ExecuteContext; import org.jooq.Field; import org.jooq.Record; @@ -425,14 +426,16 @@ extends BaseTest[] records; BatchStore(Executor create, UpdatableRecord[] records) { @@ -73,6 +73,11 @@ class BatchStore implements Batch { this.records = records; } + @Override + public final int size() { + return records.length; + } + @Override public final int[] execute() throws DataAccessException {