Class ExecuteBatchDmlResponse (6.60.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

RESULT_SETS_FIELD_NUMBER

public static final int RESULT_SETS_FIELD_NUMBER
Field Value
TypeDescription
int

STATUS_FIELD_NUMBER

public static final int STATUS_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static ExecuteBatchDmlResponse getDefaultInstance()
Returns
TypeDescription
ExecuteBatchDmlResponse

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static ExecuteBatchDmlResponse.Builder newBuilder()
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder

newBuilder(ExecuteBatchDmlResponse prototype)

public static ExecuteBatchDmlResponse.Builder newBuilder(ExecuteBatchDmlResponse prototype)
Parameter
NameDescription
prototypeExecuteBatchDmlResponse
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder

parseDelimitedFrom(InputStream input)

public static ExecuteBatchDmlResponse parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
ExecuteBatchDmlResponse
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ExecuteBatchDmlResponse parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ExecuteBatchDmlResponse
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static ExecuteBatchDmlResponse parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
ExecuteBatchDmlResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ExecuteBatchDmlResponse parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ExecuteBatchDmlResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ExecuteBatchDmlResponse parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
ExecuteBatchDmlResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ExecuteBatchDmlResponse parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ExecuteBatchDmlResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ExecuteBatchDmlResponse parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
ExecuteBatchDmlResponse
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ExecuteBatchDmlResponse parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ExecuteBatchDmlResponse
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static ExecuteBatchDmlResponse parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
ExecuteBatchDmlResponse
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ExecuteBatchDmlResponse parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ExecuteBatchDmlResponse
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static ExecuteBatchDmlResponse parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
ExecuteBatchDmlResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ExecuteBatchDmlResponse parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ExecuteBatchDmlResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<ExecuteBatchDmlResponse> parser()
Returns
TypeDescription
Parser<ExecuteBatchDmlResponse>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public ExecuteBatchDmlResponse getDefaultInstanceForType()
Returns
TypeDescription
ExecuteBatchDmlResponse

getParserForType()

public Parser<ExecuteBatchDmlResponse> getParserForType()
Returns
TypeDescription
Parser<ExecuteBatchDmlResponse>
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
List<? extends com.google.spanner.v1.ResultSetOrBuilder>

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the status field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public ExecuteBatchDmlResponse.Builder newBuilderForType()
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ExecuteBatchDmlResponse.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public ExecuteBatchDmlResponse.Builder toBuilder()
Returns
TypeDescription
ExecuteBatchDmlResponse.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException