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:
- Check the status in the response message. The google.rpc.Code enum
value
OK
indicates that all statements were executed successfully.
- 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:
- Request: 5 DML statements, all executed successfully.
- Response: 5 ResultSet messages, with the status
OK
.
Example 2:
- Request: 5 DML statements. The third statement has a syntax error.
- 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
Name | Description |
values | Iterable<? extends com.google.spanner.v1.ResultSet>
|
Returns
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public ExecuteBatchDmlResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
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
Returns
build()
public ExecuteBatchDmlResponse build()
Returns
buildPartial()
public ExecuteBatchDmlResponse buildPartial()
Returns
clear()
public ExecuteBatchDmlResponse.Builder clear()
Returns
Overrides
clearField(Descriptors.FieldDescriptor field)
public ExecuteBatchDmlResponse.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public ExecuteBatchDmlResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
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
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
clone()
public ExecuteBatchDmlResponse.Builder clone()
Returns
Overrides
getDefaultInstanceForType()
public ExecuteBatchDmlResponse getDefaultInstanceForType()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns
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
Returns
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
Returns
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
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
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
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
Returns
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 | |
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
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
public ExecuteBatchDmlResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
mergeFrom(Message other)
public ExecuteBatchDmlResponse.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
mergeFrom(ExecuteBatchDmlResponse other)
public ExecuteBatchDmlResponse.Builder mergeFrom(ExecuteBatchDmlResponse other)
Parameter
Returns
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
mergeUnknownFields(UnknownFieldSet unknownFields)
public final ExecuteBatchDmlResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
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
Returns
setField(Descriptors.FieldDescriptor field, Object value)
public ExecuteBatchDmlResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public ExecuteBatchDmlResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
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
Returns
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
Returns
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
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
setUnknownFields(UnknownFieldSet unknownFields)
public final ExecuteBatchDmlResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides