[#2426] Add DSLContext.batch(Query, Object[]...) as a convenience for

calling batch(Query).bind(Object...).bind(Object...)
This commit is contained in:
Lukas Eder 2013-05-01 16:54:21 +02:00
parent 5c196c57e9
commit fff27acbeb
2 changed files with 22 additions and 0 deletions

View File

@ -4070,6 +4070,22 @@ public interface DSLContext {
@Support
BatchBindStep batch(Query query);
/**
* Execute a set of queries in batch mode (with bind values).
* <p>
* This is a convenience method for calling {@link #batch(Query)} and then
* binding values one by one using {@link BatchBindStep#bind(Object...)}
* <p>
* Note: bind values will be inlined to a static batch query as in
* {@link #batch(Query...)}, if you choose to execute queries with
* <code>{@link Settings#getStatementType()} == {@link StatementType#STATIC_STATEMENT}</code>
*
* @see #batch(Query)
* @see Statement#executeBatch()
*/
@Support
Batch batch(Query query, Object[]... bindings);
/**
* Execute a set of <code>INSERT</code> and <code>UPDATE</code> queries in
* batch mode (with bind values).

View File

@ -1374,6 +1374,12 @@ class DSLContextImpl implements DSLContext, Serializable {
return new BatchSingle(configuration, query);
}
@Override
@Support
public final Batch batch(Query query, Object[]... bindings) {
return batch(query).bind(bindings);
}
@Override
@Support
public final Batch batchStore(UpdatableRecord<?>... records) {