Interface JdbcClient.BatchSpec

Enclosing interface:
JdbcClient

public static interface JdbcClient.BatchSpec
A specification for accumulating several sets of parameters for a batch update, with each set representing the parameters for one statement execution within the batch.

Parameters are bound in the same fashion as for a single JdbcClient.StatementSpec, either as JDBC-style positional parameters or as Spring-style named parameters (but not both within the same batch). A batch entry is completed and a new one started through add(); the final entry is completed implicitly by update().

Since:
7.1
Author:
Juergen Hoeller, Sam Brannen, Jiri Krokviak, Yanming Zhou
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    add()
    Complete the current set of parameters as one batch entry and start a new one for the subsequent parameter bindings.
    Bind a positional parameter for the current batch entry.
    param(String name, @Nullable Object value)
    Bind a named parameter for the current batch entry.
    params(Object... values)
    Bind a var-args list of positional parameters for the current batch entry.
    params(List<?> values)
    Bind a list of positional parameters for the current batch entry.
    params(Map<String,?> paramMap)
    Bind named parameters for the current batch entry.
    paramSource(Object namedParamObject)
    Provide all named parameters for the current batch entry based on the properties, record components, or fields of the given parameter object.
    paramSource(SqlParameterSource namedParamSource)
    Provide all named parameters for the current batch entry through the given parameter source.
    int[]
    Execute the accumulated sets of parameters as a batch update, completing the current (final) set as the last batch entry.
    int[]
    update(KeyHolder generatedKeyHolder)
    Execute the accumulated sets of parameters as a batch update, completing the current (final) set as the last batch entry, returning generated keys.
    int[]
    update(KeyHolder generatedKeyHolder, String... keyColumnNames)
    Execute the accumulated sets of parameters as a batch update, completing the current (final) set as the last batch entry, returning generated keys.