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 class
Mutation.Builder
A modification to one or more Cloud Spanner rows.static class
Mutation.Delete
Arguments to [delete][google.spanner.v1.Mutation.delete] operations.static interface
Mutation.DeleteOrBuilder
static class
Mutation.OperationCase
static class
Mutation.Write
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
Mutation.WriteOrBuilder
-
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
-
-
Field Summary
Fields Modifier and Type Field Description static int
DELETE_FIELD_NUMBER
static int
INSERT_FIELD_NUMBER
static int
INSERT_OR_UPDATE_FIELD_NUMBER
static int
REPLACE_FIELD_NUMBER
static int
UPDATE_FIELD_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
static Mutation
getDefaultInstance()
Mutation
getDefaultInstanceForType()
Mutation.Delete
getDelete()
Delete rows from a table.Mutation.DeleteOrBuilder
getDeleteOrBuilder()
Delete rows from a table.static com.google.protobuf.Descriptors.Descriptor
getDescriptor()
Mutation.Write
getInsert()
Insert new rows in a table.Mutation.WriteOrBuilder
getInsertOrBuilder()
Insert new rows in a table.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.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.Mutation.OperationCase
getOperationCase()
com.google.protobuf.Parser<Mutation>
getParserForType()
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.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.int
getSerializedSize()
Mutation.Write
getUpdate()
Update existing rows in a table.Mutation.WriteOrBuilder
getUpdateOrBuilder()
Update existing rows in a table.boolean
hasDelete()
Delete rows from a table.int
hashCode()
boolean
hasInsert()
Insert new rows in a table.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.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.boolean
hasUpdate()
Update existing rows in a table.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()
boolean
isInitialized()
static Mutation.Builder
newBuilder()
static Mutation.Builder
newBuilder(Mutation prototype)
Mutation.Builder
newBuilderForType()
protected Mutation.Builder
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
protected Object
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
static Mutation
parseDelimitedFrom(InputStream input)
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
parseFrom(InputStream input)
static Mutation
parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static Mutation
parseFrom(ByteBuffer data)
static Mutation
parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.protobuf.Parser<Mutation>
parser()
Mutation.Builder
toBuilder()
void
writeTo(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, getUnknownFields, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, 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
-
-
-
-
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:
newInstance
in classcom.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 classcom.google.protobuf.GeneratedMessageV3
-
getOperationCase
public Mutation.OperationCase getOperationCase()
- Specified by:
getOperationCase
in 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:
hasInsert
in 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:
getInsert
in 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:
getInsertOrBuilder
in 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:
hasUpdate
in 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:
getUpdate
in 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:
getUpdateOrBuilder
in 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:
hasInsertOrUpdate
in 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:
getInsertOrUpdate
in 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:
getInsertOrUpdateOrBuilder
in 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:
hasReplace
in 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:
getReplace
in 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:
getReplaceOrBuilder
in 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:
hasDelete
in 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:
getDelete
in 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:
getDeleteOrBuilder
in interfaceMutationOrBuilder
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
- Specified by:
writeTo
in interfacecom.google.protobuf.MessageLite
- Overrides:
writeTo
in classcom.google.protobuf.GeneratedMessageV3
- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSize
in interfacecom.google.protobuf.MessageLite
- Overrides:
getSerializedSize
in classcom.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in interfacecom.google.protobuf.Message
- Overrides:
equals
in classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacecom.google.protobuf.Message
- Overrides:
hashCode
in 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:
newBuilderForType
in interfacecom.google.protobuf.Message
- Specified by:
newBuilderForType
in 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:
toBuilder
in interfacecom.google.protobuf.Message
- Specified by:
toBuilder
in interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected Mutation.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForType
in 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:
getParserForType
in interfacecom.google.protobuf.Message
- Specified by:
getParserForType
in interfacecom.google.protobuf.MessageLite
- Overrides:
getParserForType
in classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public Mutation getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
-