Class ExecuteBatchDmlResponse.Builder

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

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
NameDescription
valuesIterable<? extends com.google.spanner.v1.ResultSet>
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ExecuteBatchDmlResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueResultSet
Returns
TypeDescription
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
NameDescription
builderForValueResultSet.Builder
Returns
TypeDescription
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
NameDescription
indexint
valueResultSet
Returns
TypeDescription
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
NameDescription
indexint
builderForValueResultSet.Builder
Returns
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
ResultSet.Builder

build()

public ExecuteBatchDmlResponse build()
Returns
TypeDescription
ExecuteBatchDmlResponse

buildPartial()

public ExecuteBatchDmlResponse buildPartial()
Returns
TypeDescription
ExecuteBatchDmlResponse

clear()

public ExecuteBatchDmlResponse.Builder clear()
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public ExecuteBatchDmlResponse.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public ExecuteBatchDmlResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder
Overrides

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

clone()

public ExecuteBatchDmlResponse.Builder clone()
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder
Overrides

getDefaultInstanceForType()

public ExecuteBatchDmlResponse getDefaultInstanceForType()
Returns
TypeDescription
ExecuteBatchDmlResponse

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
com.google.rpc.StatusOrBuilder

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
TypeDescription
boolean

Whether the status field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ExecuteBatchDmlResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public ExecuteBatchDmlResponse.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder
Overrides

mergeFrom(ExecuteBatchDmlResponse other)

public ExecuteBatchDmlResponse.Builder mergeFrom(ExecuteBatchDmlResponse other)
Parameter
NameDescription
otherExecuteBatchDmlResponse
Returns
TypeDescription
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
NameDescription
valuecom.google.rpc.Status
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ExecuteBatchDmlResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public ExecuteBatchDmlResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder
Overrides

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

public ExecuteBatchDmlResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
indexint
valueResultSet
Returns
TypeDescription
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
NameDescription
indexint
builderForValueResultSet.Builder
Returns
TypeDescription
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
NameDescription
valuecom.google.rpc.Status
Returns
TypeDescription
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
NameDescription
builderForValuecom.google.rpc.Status.Builder
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final ExecuteBatchDmlResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder
Overrides