public final class ExecuteBatchDmlResponse extends GeneratedMessageV3 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
Fields
RESULT_SETS_FIELD_NUMBER
public static final int RESULT_SETS_FIELD_NUMBER
Field Value
STATUS_FIELD_NUMBER
public static final int STATUS_FIELD_NUMBER
Field Value
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getDefaultInstance()
public static ExecuteBatchDmlResponse getDefaultInstance()
Returns
getDefaultInstanceForType()
public ExecuteBatchDmlResponse getDefaultInstanceForType()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
getParserForType()
public Parser<ExecuteBatchDmlResponse> getParserForType()
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
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> | |
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
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.
|
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 | |
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
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.
|
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilder()
public static ExecuteBatchDmlResponse.Builder newBuilder()
Returns
newBuilder(ExecuteBatchDmlResponse prototype)
public static ExecuteBatchDmlResponse.Builder newBuilder(ExecuteBatchDmlResponse prototype)
Parameter
Returns
newBuilderForType()
public ExecuteBatchDmlResponse.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected ExecuteBatchDmlResponse.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
public static ExecuteBatchDmlResponse parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static ExecuteBatchDmlResponse parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static ExecuteBatchDmlResponse parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static ExecuteBatchDmlResponse parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static ExecuteBatchDmlResponse parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static ExecuteBatchDmlResponse parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static ExecuteBatchDmlResponse parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static ExecuteBatchDmlResponse parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static ExecuteBatchDmlResponse parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static ExecuteBatchDmlResponse parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static ExecuteBatchDmlResponse parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static ExecuteBatchDmlResponse parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<ExecuteBatchDmlResponse> parser()
Returns
toBuilder()
public ExecuteBatchDmlResponse.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions