Class ExecuteBatchDmlResponse.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>
com.google.spanner.v1.ExecuteBatchDmlResponse.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, ExecuteBatchDmlResponseOrBuilder, Cloneable
Enclosing class:
ExecuteBatchDmlResponse

public static final class ExecuteBatchDmlResponse.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder> implements ExecuteBatchDmlResponseOrBuilder
 The response for
 [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list
 of [ResultSet][google.spanner.v1.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][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][google.spanner.v1.ResultSet] messages, then statement `N+1` in
    the request failed.

 Example 1:

 * Request: 5 DML statements, all executed successfully.
 * Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the
 status `OK`.

 Example 2:

 * Request: 5 DML statements. The third statement has a syntax error.
 * Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax
 error (`INVALID_ARGUMENT`)
   status. The number of [ResultSet][google.spanner.v1.ResultSet] messages
   indicates that the third statement failed, and the fourth and fifth
   statements were not executed.
 
Protobuf type google.spanner.v1.ExecuteBatchDmlResponse
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>
    • getDefaultInstanceForType

      public ExecuteBatchDmlResponse getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public ExecuteBatchDmlResponse build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public ExecuteBatchDmlResponse buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>
    • setField

      public ExecuteBatchDmlResponse.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>
    • clearField

      public ExecuteBatchDmlResponse.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>
    • clearOneof

      public ExecuteBatchDmlResponse.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>
    • setRepeatedField

      public ExecuteBatchDmlResponse.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>
    • addRepeatedField

      public ExecuteBatchDmlResponse.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>
    • mergeFrom

      public ExecuteBatchDmlResponse.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ExecuteBatchDmlResponse.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>
    • mergeFrom

      public ExecuteBatchDmlResponse.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ExecuteBatchDmlResponse.Builder>
      Throws:
      IOException
    • getResultSetsList

      public List<ResultSet> getResultSetsList()
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
      Specified by:
      getResultSetsList in interface ExecuteBatchDmlResponseOrBuilder
    • getResultSetsCount

      public int getResultSetsCount()
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
      Specified by:
      getResultSetsCount in interface ExecuteBatchDmlResponseOrBuilder
    • getResultSets

      public ResultSet getResultSets(int index)
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
      Specified by:
      getResultSets in interface ExecuteBatchDmlResponseOrBuilder
    • setResultSets

      public ExecuteBatchDmlResponse.Builder setResultSets(int index, ResultSet value)
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • setResultSets

      public ExecuteBatchDmlResponse.Builder setResultSets(int index, ResultSet.Builder builderForValue)
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • addResultSets

      public ExecuteBatchDmlResponse.Builder addResultSets(ResultSet value)
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • addResultSets

      public ExecuteBatchDmlResponse.Builder addResultSets(int index, ResultSet value)
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • addResultSets

      public ExecuteBatchDmlResponse.Builder addResultSets(ResultSet.Builder builderForValue)
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • addResultSets

      public ExecuteBatchDmlResponse.Builder addResultSets(int index, ResultSet.Builder builderForValue)
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • addAllResultSets

      public ExecuteBatchDmlResponse.Builder addAllResultSets(Iterable<? extends ResultSet> values)
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • clearResultSets

      public ExecuteBatchDmlResponse.Builder clearResultSets()
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • removeResultSets

      public ExecuteBatchDmlResponse.Builder removeResultSets(int index)
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • getResultSetsBuilder

      public ResultSet.Builder getResultSetsBuilder(int index)
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • getResultSetsOrBuilder

      public ResultSetOrBuilder getResultSetsOrBuilder(int index)
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
      Specified by:
      getResultSetsOrBuilder in interface ExecuteBatchDmlResponseOrBuilder
    • getResultSetsOrBuilderList

      public List<? extends ResultSetOrBuilder> getResultSetsOrBuilderList()
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
      Specified by:
      getResultSetsOrBuilderList in interface ExecuteBatchDmlResponseOrBuilder
    • addResultSetsBuilder

      public ResultSet.Builder addResultSetsBuilder()
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • addResultSetsBuilder

      public ResultSet.Builder addResultSetsBuilder(int index)
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • getResultSetsBuilderList

      public List<ResultSet.Builder> getResultSetsBuilderList()
       One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
       request that ran successfully, in the same order as the statements in the
       request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
       rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
       [ResultSet][google.spanner.v1.ResultSet] contain the number of rows
       modified by the statement.
      
       Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
       contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
       
      repeated .google.spanner.v1.ResultSet result_sets = 1;
    • 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;
      Specified by:
      hasStatus in interface ExecuteBatchDmlResponseOrBuilder
      Returns:
      Whether the status field is set.
    • getStatus

      public com.google.rpc.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;
      Specified by:
      getStatus in interface ExecuteBatchDmlResponseOrBuilder
      Returns:
      The status.
    • setStatus

      public ExecuteBatchDmlResponse.Builder setStatus(com.google.rpc.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;
    • setStatus

      public ExecuteBatchDmlResponse.Builder setStatus(com.google.rpc.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;
    • mergeStatus

      public ExecuteBatchDmlResponse.Builder mergeStatus(com.google.rpc.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;
    • 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;
    • getStatusBuilder

      public com.google.rpc.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;
    • getStatusOrBuilder

      public com.google.rpc.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;
      Specified by:
      getStatusOrBuilder in interface ExecuteBatchDmlResponseOrBuilder
    • setUnknownFields

      public final ExecuteBatchDmlResponse.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>
    • mergeUnknownFields

      public final ExecuteBatchDmlResponse.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ExecuteBatchDmlResponse.Builder>