Class ExecuteBatchDmlResponse (6.79.0)

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:

  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

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()
Returns
Type Description
ExecuteBatchDmlResponse

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static ExecuteBatchDmlResponse.Builder newBuilder()
Returns
Type Description
ExecuteBatchDmlResponse.Builder

newBuilder(ExecuteBatchDmlResponse prototype)

public static ExecuteBatchDmlResponse.Builder newBuilder(ExecuteBatchDmlResponse prototype)
Parameter
Name Description
prototype ExecuteBatchDmlResponse
Returns
Type Description
ExecuteBatchDmlResponse.Builder

parseDelimitedFrom(InputStream input)

public static ExecuteBatchDmlResponse parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ExecuteBatchDmlResponse
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ExecuteBatchDmlResponse parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ExecuteBatchDmlResponse
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static ExecuteBatchDmlResponse parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
ExecuteBatchDmlResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ExecuteBatchDmlResponse parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ExecuteBatchDmlResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ExecuteBatchDmlResponse parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
ExecuteBatchDmlResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ExecuteBatchDmlResponse parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ExecuteBatchDmlResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ExecuteBatchDmlResponse parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
ExecuteBatchDmlResponse
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ExecuteBatchDmlResponse parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ExecuteBatchDmlResponse
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static ExecuteBatchDmlResponse parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ExecuteBatchDmlResponse
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ExecuteBatchDmlResponse parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ExecuteBatchDmlResponse
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static ExecuteBatchDmlResponse parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
ExecuteBatchDmlResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ExecuteBatchDmlResponse parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ExecuteBatchDmlResponse
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<ExecuteBatchDmlResponse> parser()
Returns
Type Description
Parser<ExecuteBatchDmlResponse>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public ExecuteBatchDmlResponse getDefaultInstanceForType()
Returns
Type Description
ExecuteBatchDmlResponse

getParserForType()

public Parser<ExecuteBatchDmlResponse> getParserForType()
Returns
Type Description
Parser<ExecuteBatchDmlResponse>
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];

Returns
Type Description
MultiplexedSessionPrecommitToken

The precommitToken.

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];

Returns
Type Description
MultiplexedSessionPrecommitTokenOrBuilder

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
Returns
Type Description
ResultSet

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;

Returns
Type Description
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
Name Description
index int
Returns
Type Description
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
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()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public ExecuteBatchDmlResponse.Builder newBuilderForType()
Returns
Type Description
ExecuteBatchDmlResponse.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ExecuteBatchDmlResponse.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
ExecuteBatchDmlResponse.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public ExecuteBatchDmlResponse.Builder toBuilder()
Returns
Type Description
ExecuteBatchDmlResponse.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException