Class ExecuteBatchDmlResponse.Builder (6.77.0)

public static final class ExecuteBatchDmlResponse.Builder extends GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder> implements ExecuteBatchDmlResponseOrBuilder

The response for ExecuteBatchDml. Contains a list of ResultSet messages, one for each DML statement that has successfully executed, in the same order as the statements in the request. If a statement fails, the status in the response body identifies the cause of the failure.

To check for DML statements that failed, use the following approach:

  1. Check the status in the response message. The google.rpc.Code enum value OK indicates that all statements were executed successfully.
  2. If the status was not OK, check the number of result sets in the response. If the response contains N ResultSet messages, then statement N+1 in the request failed.

    Example 1:

  3. Request: 5 DML statements, all executed successfully.

  4. Response: 5 ResultSet messages, with the status OK.

    Example 2:

  5. Request: 5 DML statements. The third statement has a syntax error.

  6. Response: 2 ResultSet messages, and a syntax error (INVALID_ARGUMENT) status. The number of ResultSet messages indicates that the third statement failed, and the fourth and fifth statements were not executed.

Protobuf type google.spanner.v1.ExecuteBatchDmlResponse

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllResultSets(Iterable<? extends ResultSet> values)

public ExecuteBatchDmlResponse.Builder addAllResultSets(Iterable<? extends ResultSet> values)

One ResultSet for each statement in the request that ran successfully, in the same order as the statements in the request. Each ResultSet does not contain any rows. The ResultSetStats in each ResultSet contain the number of rows modified by the statement.

Only the first ResultSet in the response contains valid ResultSetMetadata.

repeated .google.spanner.v1.ResultSet result_sets = 1;

Parameter
Name Description
values Iterable<? extends com.google.spanner.v1.ResultSet>
Returns
Type Description
ExecuteBatchDmlResponse.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ExecuteBatchDmlResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ExecuteBatchDmlResponse.Builder
Overrides

addResultSets(ResultSet value)

public ExecuteBatchDmlResponse.Builder addResultSets(ResultSet value)

One ResultSet for each statement in the request that ran successfully, in the same order as the statements in the request. Each ResultSet does not contain any rows. The ResultSetStats in each ResultSet contain the number of rows modified by the statement.

Only the first ResultSet in the response contains valid ResultSetMetadata.

repeated .google.spanner.v1.ResultSet result_sets = 1;

Parameter
Name Description
value ResultSet
Returns
Type Description
ExecuteBatchDmlResponse.Builder

addResultSets(ResultSet.Builder builderForValue)

public ExecuteBatchDmlResponse.Builder addResultSets(ResultSet.Builder builderForValue)

One ResultSet for each statement in the request that ran successfully, in the same order as the statements in the request. Each ResultSet does not contain any rows. The ResultSetStats in each ResultSet contain the number of rows modified by the statement.

Only the first ResultSet in the response contains valid ResultSetMetadata.

repeated .google.spanner.v1.ResultSet result_sets = 1;

Parameter
Name Description
builderForValue ResultSet.Builder
Returns
Type Description
ExecuteBatchDmlResponse.Builder

addResultSets(int index, ResultSet value)

public ExecuteBatchDmlResponse.Builder addResultSets(int index, ResultSet value)

One ResultSet for each statement in the request that ran successfully, in the same order as the statements in the request. Each ResultSet does not contain any rows. The ResultSetStats in each ResultSet contain the number of rows modified by the statement.

Only the first ResultSet in the response contains valid ResultSetMetadata.

repeated .google.spanner.v1.ResultSet result_sets = 1;

Parameters
Name Description
index int
value ResultSet
Returns
Type Description
ExecuteBatchDmlResponse.Builder

addResultSets(int index, ResultSet.Builder builderForValue)

public ExecuteBatchDmlResponse.Builder addResultSets(int index, ResultSet.Builder builderForValue)

One ResultSet for each statement in the request that ran successfully, in the same order as the statements in the request. Each ResultSet does not contain any rows. The ResultSetStats in each ResultSet contain the number of rows modified by the statement.

Only the first ResultSet in the response contains valid ResultSetMetadata.

repeated .google.spanner.v1.ResultSet result_sets = 1;

Parameters
Name Description
index int
builderForValue ResultSet.Builder
Returns
Type Description
ExecuteBatchDmlResponse.Builder

addResultSetsBuilder()

public ResultSet.Builder addResultSetsBuilder()

One ResultSet for each statement in the request that ran successfully, in the same order as the statements in the request. Each ResultSet does not contain any rows. The ResultSetStats in each ResultSet contain the number of rows modified by the statement.

Only the first ResultSet in the response contains valid ResultSetMetadata.

repeated .google.spanner.v1.ResultSet result_sets = 1;

Returns
Type Description
ResultSet.Builder

addResultSetsBuilder(int index)

public ResultSet.Builder addResultSetsBuilder(int index)

One ResultSet for each statement in the request that ran successfully, in the same order as the statements in the request. Each ResultSet does not contain any rows. The ResultSetStats in each ResultSet contain the number of rows modified by the statement.

Only the first ResultSet in the response contains valid ResultSetMetadata.

repeated .google.spanner.v1.ResultSet result_sets = 1;

Parameter
Name Description
index int
Returns
Type Description
ResultSet.Builder

build()

public ExecuteBatchDmlResponse build()
Returns
Type Description
ExecuteBatchDmlResponse

buildPartial()

public ExecuteBatchDmlResponse buildPartial()
Returns
Type Description
ExecuteBatchDmlResponse

clear()

public ExecuteBatchDmlResponse.Builder clear()
Returns
Type Description
ExecuteBatchDmlResponse.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public ExecuteBatchDmlResponse.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
ExecuteBatchDmlResponse.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)<