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
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
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>
|
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public ExecuteBatchDmlResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
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;
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;
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;
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;
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;
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
|
build()
public ExecuteBatchDmlResponse build()
buildPartial()
public ExecuteBatchDmlResponse buildPartial()
clear()
public ExecuteBatchDmlResponse.Builder clear()
Overrides
clearField(Descriptors.FieldDescriptor field)
public ExecuteBatchDmlResponse.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public ExecuteBatchDmlResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
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;
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;
clone()
public ExecuteBatchDmlResponse.Builder clone()
Overrides
getDefaultInstanceForType()
public ExecuteBatchDmlResponse getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
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 |
---|
Name | Description |
index | int
|
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
|
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;
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;
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
|
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()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
public ExecuteBatchDmlResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public ExecuteBatchDmlResponse.Builder mergeFrom(Message other)
Parameter |
---|
Name | Description |
other | Message
|
Overrides
mergeFrom(ExecuteBatchDmlResponse other)
public ExecuteBatchDmlResponse.Builder mergeFrom(ExecuteBatchDmlResponse other)
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
|
mergeUnknownFields(UnknownFieldSet unknownFields)
public final ExecuteBatchDmlResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
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
|
setField(Descriptors.FieldDescriptor field, Object value)
public ExecuteBatchDmlResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public ExecuteBatchDmlResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
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;
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;
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
|
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
|
setUnknownFields(UnknownFieldSet unknownFields)
public final ExecuteBatchDmlResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides