Class ExecuteBatchDmlResponse.Builder (6.83.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)

public ExecuteBatchDmlResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
ExecuteBatchDmlResponse.Builder
Overrides

clearPrecommitToken()

public ExecuteBatchDmlResponse.Builder clearPrecommitToken()

Optional. A precommit token will be included if the read-write transaction is on a multiplexed session. The precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ExecuteBatchDmlResponse.Builder

clearResultSets()

public ExecuteBatchDmlResponse.Builder clearResultSets()

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
ExecuteBatchDmlResponse.Builder

clearStatus()

public ExecuteBatchDmlResponse.Builder clearStatus()

If all DML statements are executed successfully, the status is OK. Otherwise, the error status of the first failed statement.

.google.rpc.Status status = 2;

Returns
Type Description
ExecuteBatchDmlResponse.Builder

clone()

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

getDefaultInstanceForType()

public ExecuteBatchDmlResponse getDefaultInstanceForType()
Returns
Type Description
ExecuteBatchDmlResponse

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getPrecommitToken()

public MultiplexedSessionPrecommitToken getPrecommitToken()

Optional. A precommit token will be included if the read-write transaction is on a multiplexed session. The precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
MultiplexedSessionPrecommitToken

The precommitToken.

getPrecommitTokenBuilder()

public MultiplexedSessionPrecommitToken.Builder getPrecommitTokenBuilder()

Optional. A precommit token will be included if the read-write transaction is on a multiplexed session. The precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
MultiplexedSessionPrecommitToken.Builder

getPrecommitTokenOrBuilder()

public MultiplexedSessionPrecommitTokenOrBuilder getPrecommitTokenOrBuilder()

Optional. A precommit token will be included if the read-write transaction is on a multiplexed session. The precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
MultiplexedSessionPrecommitTokenOrBuilder

getResultSets(int index)

public ResultSet getResultSets(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

getResultSetsBuilder(int index)

public ResultSet.Builder getResultSetsBuilder(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

getResultSetsBuilderList()

public List<ResultSet.Builder> getResultSetsBuilderList()

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
List<Builder>

getResultSetsCount()

public int getResultSetsCount()

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
int

getResultSetsList()

public List<ResultSet> getResultSetsList()

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
List<ResultSet>

getResultSetsOrBuilder(int index)

public ResultSetOrBuilder getResultSetsOrBuilder(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
ResultSetOrBuilder

getResultSetsOrBuilderList()

public List<? extends ResultSetOrBuilder> getResultSetsOrBuilderList()

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
List<? extends com.google.spanner.v1.ResultSetOrBuilder>

getStatus()

public Status getStatus()

If all DML statements are executed successfully, the status is OK. Otherwise, the error status of the first failed statement.

.google.rpc.Status status = 2;

Returns
Type Description
com.google.rpc.Status

The status.

getStatusBuilder()

public Status.Builder getStatusBuilder()

If all DML statements are executed successfully, the status is OK. Otherwise, the error status of the first failed statement.

.google.rpc.Status status = 2;

Returns
Type Description
com.google.rpc.Status.Builder

getStatusOrBuilder()

public StatusOrBuilder getStatusOrBuilder()

If all DML statements are executed successfully, the status is OK. Otherwise, the error status of the first failed statement.

.google.rpc.Status status = 2;

Returns
Type Description
com.google.rpc.StatusOrBuilder

hasPrecommitToken()

public boolean hasPrecommitToken()

Optional. A precommit token will be included if the read-write transaction is on a multiplexed session. The precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the precommitToken field is set.

hasStatus()

public boolean hasStatus()

If all DML statements are executed successfully, the status is OK. Otherwise, the error status of the first failed statement.

.google.rpc.Status status = 2;

Returns
Type Description
boolean

Whether the status field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ExecuteBatchDmlResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ExecuteBatchDmlResponse.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public ExecuteBatchDmlResponse.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
ExecuteBatchDmlResponse.Builder
Overrides

mergeFrom(ExecuteBatchDmlResponse other)

public ExecuteBatchDmlResponse.Builder mergeFrom(ExecuteBatchDmlResponse other)
Parameter
Name Description
other ExecuteBatchDmlResponse
Returns
Type Description
ExecuteBatchDmlResponse.Builder

mergePrecommitToken(MultiplexedSessionPrecommitToken value)

public ExecuteBatchDmlResponse.Builder mergePrecommitToken(MultiplexedSessionPrecommitToken value)

Optional. A precommit token will be included if the read-write transaction is on a multiplexed session. The precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value MultiplexedSessionPrecommitToken
Returns
Type Description
ExecuteBatchDmlResponse.Builder

mergeStatus(Status value)

public ExecuteBatchDmlResponse.Builder mergeStatus(Status value)

If all DML statements are executed successfully, the status is OK. Otherwise, the error status of the first failed statement.

.google.rpc.Status status = 2;

Parameter
Name Description
value com.google.rpc.Status
Returns
Type Description
ExecuteBatchDmlResponse.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ExecuteBatchDmlResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ExecuteBatchDmlResponse.Builder
Overrides

removeResultSets(int index)

public ExecuteBatchDmlResponse.Builder removeResultSets(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
ExecuteBatchDmlResponse.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

setPrecommitToken(MultiplexedSessionPrecommitToken value)

public ExecuteBatchDmlResponse.Builder setPrecommitToken(MultiplexedSessionPrecommitToken value)

Optional. A precommit token will be included if the read-write transaction is on a multiplexed session. The precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value MultiplexedSessionPrecommitToken
Returns
Type Description
ExecuteBatchDmlResponse.Builder

setPrecommitToken(MultiplexedSessionPrecommitToken.Builder builderForValue)

public ExecuteBatchDmlResponse.Builder setPrecommitToken(MultiplexedSessionPrecommitToken.Builder builderForValue)

Optional. A precommit token will be included if the read-write transaction is on a multiplexed session. The precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL];

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

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

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

setResultSets(int index, ResultSet value)

public ExecuteBatchDmlResponse.Builder setResultSets(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

setResultSets(int index, ResultSet.Builder builderForValue)

public ExecuteBatchDmlResponse.Builder setResultSets(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

setStatus(Status value)

public ExecuteBatchDmlResponse.Builder setStatus(Status value)

If all DML statements are executed successfully, the status is OK. Otherwise, the error status of the first failed statement.

.google.rpc.Status status = 2;

Parameter
Name Description
value com.google.rpc.Status
Returns
Type Description
ExecuteBatchDmlResponse.Builder

setStatus(Status.Builder builderForValue)

public ExecuteBatchDmlResponse.Builder setStatus(Status.Builder builderForValue)

If all DML statements are executed successfully, the status is OK. Otherwise, the error status of the first failed statement.

.google.rpc.Status status = 2;

Parameter
Name Description
builderForValue com.google.rpc.Status.Builder
Returns
Type Description
ExecuteBatchDmlResponse.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final ExecuteBatchDmlResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ExecuteBatchDmlResponse.Builder
Overrides