Class Mutation (6.25.1)

public final class Mutation extends 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 call.

Protobuf type google.spanner.v1.Mutation

Implements

MutationOrBuilder

Static Fields

DELETE_FIELD_NUMBER

public static final int DELETE_FIELD_NUMBER
Field Value
TypeDescription
int

INSERT_FIELD_NUMBER

public static final int INSERT_FIELD_NUMBER
Field Value
TypeDescription
int

INSERT_OR_UPDATE_FIELD_NUMBER

public static final int INSERT_OR_UPDATE_FIELD_NUMBER
Field Value
TypeDescription
int

REPLACE_FIELD_NUMBER

public static final int REPLACE_FIELD_NUMBER
Field Value
TypeDescription
int

UPDATE_FIELD_NUMBER

public static final int UPDATE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Mutation getDefaultInstance()
Returns
TypeDescription
Mutation

getDescriptor()

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

newBuilder()

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

newBuilder(Mutation prototype)

public static Mutation.Builder newBuilder(Mutation prototype)
Parameter
NameDescription
prototypeMutation
Returns
TypeDescription
Mutation.Builder

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getDefaultInstanceForType()

public Mutation getDefaultInstanceForType()
Returns
TypeDescription
Mutation

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;

Returns
TypeDescription
Mutation.Delete

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;

Returns
TypeDescription
Mutation.DeleteOrBuilder

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;

Returns
TypeDescription
Mutation.Write

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;

Returns
TypeDescription
Mutation.WriteOrBuilder

getInsertOrUpdate()

public Mutation.Write getInsertOrUpdate()

Like 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, just as when using 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;

Returns
TypeDescription
Mutation.Write

The insertOrUpdate.

getInsertOrUpdateOrBuilder()

public Mutation.WriteOrBuilder getInsertOrUpdateOrBuilder()

Like 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, just as when using 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;

Returns
TypeDescription
Mutation.WriteOrBuilder

getOperationCase()

public Mutation.OperationCase getOperationCase()
Returns
TypeDescription
Mutation.OperationCase

getParserForType()

public Parser<Mutation> getParserForType()
Returns
TypeDescription
Parser<Mutation>
Overrides

getReplace()

public Mutation.Write getReplace()

Like insert, except that if the row already exists, it is deleted, and the column values provided are inserted instead. Unlike 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;

Returns
TypeDescription
Mutation.Write

The replace.

getReplaceOrBuilder()

public Mutation.WriteOrBuilder getReplaceOrBuilder()

Like insert, except that if the row already exists, it is deleted, and the column values provided are inserted instead. Unlike 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;

Returns
TypeDescription
Mutation.WriteOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

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;

Returns
TypeDescription
Mutation.Write

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;

Returns
TypeDescription
Mutation.WriteOrBuilder

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;

Returns
TypeDescription
boolean

Whether the delete field is set.

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;

Returns
TypeDescription
boolean

Whether the insert field is set.

hasInsertOrUpdate()

public boolean hasInsertOrUpdate()

Like 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, just as when using 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;

Returns
TypeDescription
boolean

Whether the insertOrUpdate field is set.

hasReplace()

public boolean hasReplace()

Like insert, except that if the row already exists, it is deleted, and the column values provided are inserted instead. Unlike 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;

Returns
TypeDescription
boolean

Whether the replace field is set.

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;

Returns
TypeDescription
boolean

Whether the update 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 Mutation.Builder newBuilderForType()
Returns
TypeDescription
Mutation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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