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
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
PRECOMMIT_TOKEN_FIELD_NUMBER
public static final int PRECOMMIT_TOKEN_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
RESULT_SETS_FIELD_NUMBER
public static final int RESULT_SETS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
STATUS_FIELD_NUMBER
public static final int STATUS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
Static Methods
getDefaultInstance()
public static ExecuteBatchDmlResponse getDefaultInstance()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static ExecuteBatchDmlResponse.Builder newBuilder()
newBuilder(ExecuteBatchDmlResponse prototype)
public static ExecuteBatchDmlResponse.Builder newBuilder(ExecuteBatchDmlResponse prototype)
public static ExecuteBatchDmlResponse parseDelimitedFrom(InputStream input)
public static ExecuteBatchDmlResponse parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static ExecuteBatchDmlResponse parseFrom(byte[] data)
Parameter |
Name |
Description |
data |
byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static ExecuteBatchDmlResponse parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static ExecuteBatchDmlResponse parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static ExecuteBatchDmlResponse parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static ExecuteBatchDmlResponse parseFrom(CodedInputStream input)
public static ExecuteBatchDmlResponse parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static ExecuteBatchDmlResponse parseFrom(InputStream input)
public static ExecuteBatchDmlResponse parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static ExecuteBatchDmlResponse parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static ExecuteBatchDmlResponse parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<ExecuteBatchDmlResponse> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
Name |
Description |
obj |
Object
|
Overrides
getDefaultInstanceForType()
public ExecuteBatchDmlResponse getDefaultInstanceForType()
getParserForType()
public Parser<ExecuteBatchDmlResponse> getParserForType()
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];
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];
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
|
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> |
|
getSerializedSize()
public int getSerializedSize()
Returns |
Type |
Description |
int |
|
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 |
|
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.
|
hashCode()
Returns |
Type |
Description |
int |
|
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public ExecuteBatchDmlResponse.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected ExecuteBatchDmlResponse.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Returns |
Type |
Description |
Object |
|
Overrides
toBuilder()
public ExecuteBatchDmlResponse.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides