[#2426] Add DSLContext.batch(Query, Object[]...) as a convenience for
calling batch(Query).bind(Object...).bind(Object...)
This commit is contained in:
parent
5c196c57e9
commit
fff27acbeb
@ -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).
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user