Class Mutation

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
com.google.spanner.v1.Mutation
All Implemented Interfaces:
com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, MutationOrBuilder, Serializable

public final class Mutation extends com.google.protobuf.GeneratedMessageV3 implements MutationOrBuilder
 A modification to one or more Cloud Spanner rows.  Mutations can be
 applied to a Cloud Spanner database by sending them in a
 [Commit][google.spanner.v1.Spanner.Commit] call.
 
Protobuf type google.spanner.v1.Mutation
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A modification to one or more Cloud Spanner rows.
    static final class 
    Arguments to [delete][google.spanner.v1.Mutation.delete] operations.
    static interface 
     
    static enum 
     
    static final class 
    Arguments to [insert][google.spanner.v1.Mutation.insert], [update][google.spanner.v1.Mutation.update], [insert_or_update][google.spanner.v1.Mutation.insert_or_update], and [replace][google.spanner.v1.Mutation.replace] operations.
    static interface 
     

    Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3

    com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter

    Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

    com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.google.protobuf.GeneratedMessageV3

    alwaysUseFieldBuilders, unknownFields

    Fields inherited from class com.google.protobuf.AbstractMessage

    memoizedSize

    Fields inherited from class com.google.protobuf.AbstractMessageLite

    memoizedHashCode
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    static Mutation
     
     
    Delete rows from a table.
    Delete rows from a table.
    static final com.google.protobuf.Descriptors.Descriptor
     
    Insert new rows in a table.
    Insert new rows in a table.
    Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then its column values are overwritten with the ones provided.
    Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then its column values are overwritten with the ones provided.
     
    com.google.protobuf.Parser<Mutation>
     
    Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is deleted, and the column values provided are inserted instead.
    Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is deleted, and the column values provided are inserted instead.
    int
     
    Update existing rows in a table.
    Update existing rows in a table.
    boolean
    Delete rows from a table.
    int
     
    boolean
    Insert new rows in a table.
    boolean
    Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then its column values are overwritten with the ones provided.
    boolean
    Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is deleted, and the column values provided are inserted instead.
    boolean
    Update existing rows in a table.
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
     
    final boolean
     
     
    newBuilder(Mutation prototype)
     
     
    newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
     
    protected Object
    newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
     
    static Mutation
     
    static Mutation
    parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Mutation
    parseFrom(byte[] data)
     
    static Mutation
    parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Mutation
    parseFrom(com.google.protobuf.ByteString data)
     
    static Mutation
    parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Mutation
    parseFrom(com.google.protobuf.CodedInputStream input)
     
    static Mutation
    parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Mutation
     
    static Mutation
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Mutation
     
    static Mutation
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<Mutation>
     
     
    void
    writeTo(com.google.protobuf.CodedOutputStream output)
     

    Methods inherited from class com.google.protobuf.GeneratedMessageV3

    canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag

    Methods inherited from class com.google.protobuf.AbstractMessage

    findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite

    addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLite

    toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from interface com.google.protobuf.MessageOrBuilder

    findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
  • Field Details

  • Method Details

    • newInstance

      protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
      Overrides:
      newInstance in class com.google.protobuf.GeneratedMessageV3
    • 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
    • getOperationCase

      public Mutation.OperationCase getOperationCase()
      Specified by:
      getOperationCase in interface MutationOrBuilder
    • hasInsert

      public boolean hasInsert()
       Insert new rows in a table. If any of the rows already exist,
       the write or transaction fails with error `ALREADY_EXISTS`.
       
      .google.spanner.v1.Mutation.Write insert = 1;
      Specified by:
      hasInsert in interface MutationOrBuilder
      Returns:
      Whether the insert field is set.
    • getInsert

      public Mutation.Write getInsert()
       Insert new rows in a table. If any of the rows already exist,
       the write or transaction fails with error `ALREADY_EXISTS`.
       
      .google.spanner.v1.Mutation.Write insert = 1;
      Specified by:
      getInsert in interface MutationOrBuilder
      Returns:
      The insert.
    • getInsertOrBuilder

      public Mutation.WriteOrBuilder getInsertOrBuilder()
       Insert new rows in a table. If any of the rows already exist,
       the write or transaction fails with error `ALREADY_EXISTS`.
       
      .google.spanner.v1.Mutation.Write insert = 1;
      Specified by:
      getInsertOrBuilder in interface MutationOrBuilder
    • hasUpdate

      public boolean hasUpdate()
       Update existing rows in a table. If any of the rows does not
       already exist, the transaction fails with error `NOT_FOUND`.
       
      .google.spanner.v1.Mutation.Write update = 2;
      Specified by:
      hasUpdate in interface MutationOrBuilder
      Returns:
      Whether the update field is set.
    • getUpdate

      public Mutation.Write getUpdate()
       Update existing rows in a table. If any of the rows does not
       already exist, the transaction fails with error `NOT_FOUND`.
       
      .google.spanner.v1.Mutation.Write update = 2;
      Specified by:
      getUpdate in interface MutationOrBuilder
      Returns:
      The update.
    • getUpdateOrBuilder

      public Mutation.WriteOrBuilder getUpdateOrBuilder()
       Update existing rows in a table. If any of the rows does not
       already exist, the transaction fails with error `NOT_FOUND`.
       
      .google.spanner.v1.Mutation.Write update = 2;
      Specified by:
      getUpdateOrBuilder in interface MutationOrBuilder
    • hasInsertOrUpdate

      public boolean hasInsertOrUpdate()
       Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
       its column values are overwritten with the ones provided. Any
       column values not explicitly written are preserved.
      
       When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
       NULL` columns in the table must be given a value. This holds true
       even when the row already exists and will therefore actually be updated.
       
      .google.spanner.v1.Mutation.Write insert_or_update = 3;
      Specified by:
      hasInsertOrUpdate in interface MutationOrBuilder
      Returns:
      Whether the insertOrUpdate field is set.
    • getInsertOrUpdate

      public Mutation.Write getInsertOrUpdate()
       Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
       its column values are overwritten with the ones provided. Any
       column values not explicitly written are preserved.
      
       When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
       NULL` columns in the table must be given a value. This holds true
       even when the row already exists and will therefore actually be updated.
       
      .google.spanner.v1.Mutation.Write insert_or_update = 3;
      Specified by:
      getInsertOrUpdate in interface MutationOrBuilder
      Returns:
      The insertOrUpdate.
    • getInsertOrUpdateOrBuilder

      public Mutation.WriteOrBuilder getInsertOrUpdateOrBuilder()
       Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
       its column values are overwritten with the ones provided. Any
       column values not explicitly written are preserved.
      
       When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
       NULL` columns in the table must be given a value. This holds true
       even when the row already exists and will therefore actually be updated.
       
      .google.spanner.v1.Mutation.Write insert_or_update = 3;
      Specified by:
      getInsertOrUpdateOrBuilder in interface MutationOrBuilder
    • hasReplace

      public boolean hasReplace()
       Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
       deleted, and the column values provided are inserted
       instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
       explicitly written become `NULL`.
      
       In an interleaved table, if you create the child table with the
       `ON DELETE CASCADE` annotation, then replacing a parent row
       also deletes the child rows. Otherwise, you must delete the
       child rows before you replace the parent row.
       
      .google.spanner.v1.Mutation.Write replace = 4;
      Specified by:
      hasReplace in interface MutationOrBuilder
      Returns:
      Whether the replace field is set.
    • getReplace

      public Mutation.Write getReplace()
       Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
       deleted, and the column values provided are inserted
       instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
       explicitly written become `NULL`.
      
       In an interleaved table, if you create the child table with the
       `ON DELETE CASCADE` annotation, then replacing a parent row
       also deletes the child rows. Otherwise, you must delete the
       child rows before you replace the parent row.
       
      .google.spanner.v1.Mutation.Write replace = 4;
      Specified by:
      getReplace in interface MutationOrBuilder
      Returns:
      The replace.
    • getReplaceOrBuilder

      public Mutation.WriteOrBuilder getReplaceOrBuilder()
       Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
       deleted, and the column values provided are inserted
       instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
       explicitly written become `NULL`.
      
       In an interleaved table, if you create the child table with the
       `ON DELETE CASCADE` annotation, then replacing a parent row
       also deletes the child rows. Otherwise, you must delete the
       child rows before you replace the parent row.
       
      .google.spanner.v1.Mutation.Write replace = 4;
      Specified by:
      getReplaceOrBuilder in interface MutationOrBuilder
    • hasDelete

      public boolean hasDelete()
       Delete rows from a table. Succeeds whether or not the named
       rows were present.
       
      .google.spanner.v1.Mutation.Delete delete = 5;
      Specified by:
      hasDelete in interface MutationOrBuilder
      Returns:
      Whether the delete field is set.
    • getDelete

      public Mutation.Delete getDelete()
       Delete rows from a table. Succeeds whether or not the named
       rows were present.
       
      .google.spanner.v1.Mutation.Delete delete = 5;
      Specified by:
      getDelete in interface MutationOrBuilder
      Returns:
      The delete.
    • getDeleteOrBuilder

      public Mutation.DeleteOrBuilder getDeleteOrBuilder()
       Delete rows from a table. Succeeds whether or not the named
       rows were present.
       
      .google.spanner.v1.Mutation.Delete delete = 5;
      Specified by:
      getDeleteOrBuilder in interface MutationOrBuilder
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessageV3
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessageV3
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static Mutation parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Mutation parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Mutation parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Mutation parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Mutation parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Mutation parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Mutation parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Mutation parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Mutation parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Mutation parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Mutation parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Mutation parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public Mutation.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static Mutation.Builder newBuilder()
    • newBuilder

      public static Mutation.Builder newBuilder(Mutation prototype)
    • toBuilder

      public Mutation.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected Mutation.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
      Specified by:
      newBuilderForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstance

      public static Mutation getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<Mutation> parser()
    • getParserForType

      public com.google.protobuf.Parser<Mutation> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstanceForType

      public Mutation getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder