[#2204] Add BatchBindStep.bind(Object[][]) to bind lots of bind values

at a time
This commit is contained in:
Lukas Eder 2013-02-15 18:17:00 +01:00
parent 3e2778122c
commit 2b3fb59dbe
2 changed files with 18 additions and 6 deletions

View File

@ -37,8 +37,6 @@ package org.jooq;
import java.sql.Statement;
import org.jooq.exception.DataAccessException;
/**
* This type is used for the {@link Batch}'s DSL API.
* <p>
@ -51,9 +49,14 @@ import org.jooq.exception.DataAccessException;
public interface BatchBindStep extends Batch {
/**
* Set bind values on the batch statement
*
* @throws DataAccessException if something went wrong executing the query
* Set bind values on the batch statement.
*/
BatchBindStep bind(Object... bindValues) throws DataAccessException;
BatchBindStep bind(Object... bindValues);
/**
* Set several bind values on the batch statement.
* <p>
* This is the same as calling {@link #bind(Object...)} several times.
*/
BatchBindStep bind(Object[][] bindValues);
}

View File

@ -74,6 +74,15 @@ class BatchSingle implements BatchBindStep {
return this;
}
@Override
public final BatchSingle bind(Object[][] bindValues) {
for (Object[] v : bindValues) {
bind(v);
}
return this;
}
@Override
public final int size() {
return allBindValues.size();