Package com.google.spanner.v1
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 typegoogle.spanner.v1.Mutation- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMutation.BuilderA modification to one or more Cloud Spanner rows.static classMutation.DeleteArguments to [delete][google.spanner.v1.Mutation.delete] operations.static interfaceMutation.DeleteOrBuilderstatic classMutation.OperationCasestatic classMutation.WriteArguments 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 interfaceMutation.WriteOrBuilder-
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
-
-
Field Summary
Fields Modifier and Type Field Description static intDELETE_FIELD_NUMBERstatic intINSERT_FIELD_NUMBERstatic intINSERT_OR_UPDATE_FIELD_NUMBERstatic intREPLACE_FIELD_NUMBERstatic intUPDATE_FIELD_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)static MutationgetDefaultInstance()MutationgetDefaultInstanceForType()Mutation.DeletegetDelete()Delete rows from a table.Mutation.DeleteOrBuildergetDeleteOrBuilder()Delete rows from a table.static com.google.protobuf.Descriptors.DescriptorgetDescriptor()Mutation.WritegetInsert()Insert new rows in a table.Mutation.WriteOrBuildergetInsertOrBuilder()Insert new rows in a table.Mutation.WritegetInsertOrUpdate()Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then its column values are overwritten with the ones provided.Mutation.WriteOrBuildergetInsertOrUpdateOrBuilder()Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then its column values are overwritten with the ones provided.Mutation.OperationCasegetOperationCase()com.google.protobuf.Parser<Mutation>getParserForType()Mutation.WritegetReplace()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.Mutation.WriteOrBuildergetReplaceOrBuilder()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.intgetSerializedSize()com.google.protobuf.UnknownFieldSetgetUnknownFields()Mutation.WritegetUpdate()Update existing rows in a table.Mutation.WriteOrBuildergetUpdateOrBuilder()Update existing rows in a table.booleanhasDelete()Delete rows from a table.inthashCode()booleanhasInsert()Insert new rows in a table.booleanhasInsertOrUpdate()Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then its column values are overwritten with the ones provided.booleanhasReplace()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.booleanhasUpdate()Update existing rows in a table.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()static Mutation.BuildernewBuilder()static Mutation.BuildernewBuilder(Mutation prototype)Mutation.BuildernewBuilderForType()protected Mutation.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)static MutationparseDelimitedFrom(InputStream input)static MutationparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static MutationparseFrom(byte[] data)static MutationparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static MutationparseFrom(com.google.protobuf.ByteString data)static MutationparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static MutationparseFrom(com.google.protobuf.CodedInputStream input)static MutationparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static MutationparseFrom(InputStream input)static MutationparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static MutationparseFrom(ByteBuffer data)static MutationparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static com.google.protobuf.Parser<Mutation>parser()Mutation.BuildertoBuilder()voidwriteTo(com.google.protobuf.CodedOutputStream output)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, 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
-
-
-
-
Field Detail
-
INSERT_FIELD_NUMBER
public static final int INSERT_FIELD_NUMBER
- See Also:
- Constant Field Values
-
UPDATE_FIELD_NUMBER
public static final int UPDATE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
INSERT_OR_UPDATE_FIELD_NUMBER
public static final int INSERT_OR_UPDATE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
REPLACE_FIELD_NUMBER
public static final int REPLACE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
DELETE_FIELD_NUMBER
public static final int DELETE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
-
Method Detail
-
newInstance
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getUnknownFields
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
- Specified by:
getUnknownFieldsin interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
getOperationCase
public Mutation.OperationCase getOperationCase()
- Specified by:
getOperationCasein interfaceMutationOrBuilder
-
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:
hasInsertin interfaceMutationOrBuilder- 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:
getInsertin interfaceMutationOrBuilder- 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:
getInsertOrBuilderin interfaceMutationOrBuilder
-
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:
hasUpdatein interfaceMutationOrBuilder- 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:
getUpdatein interfaceMutationOrBuilder- 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:
getUpdateOrBuilderin interfaceMutationOrBuilder
-
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:
hasInsertOrUpdatein interfaceMutationOrBuilder- 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:
getInsertOrUpdatein interfaceMutationOrBuilder- 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:
getInsertOrUpdateOrBuilderin interfaceMutationOrBuilder
-
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:
hasReplacein interfaceMutationOrBuilder- 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:
getReplacein interfaceMutationOrBuilder- 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:
getReplaceOrBuilderin interfaceMutationOrBuilder
-
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:
hasDeletein interfaceMutationOrBuilder- 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:
getDeletein interfaceMutationOrBuilder- 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:
getDeleteOrBuilderin interfaceMutationOrBuilder
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.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:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
public static Mutation.Builder newBuilder()
-
newBuilder
public static Mutation.Builder newBuilder(Mutation prototype)
-
toBuilder
public Mutation.Builder toBuilder()
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected Mutation.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForTypein classcom.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:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public Mutation getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
-