Class Mutation (6.69.0)

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
Type Description
int

INSERT_FIELD_NUMBER

public static final int INSERT_FIELD_NUMBER
Field Value
Type Description
int

INSERT_OR_UPDATE_FIELD_NUMBER

public static final int INSERT_OR_UPDATE_FIELD_NUMBER
Field Value
Type Description
int

REPLACE_FIELD_NUMBER

public static final int REPLACE_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_FIELD_NUMBER

public static final int UPDATE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Mutation getDefaultInstance()
Returns
Type Description
Mutation

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Mutation.Builder newBuilder()
Returns
Type Description
Mutation.Builder

newBuilder(Mutation prototype)

public static Mutation.Builder newBuilder(Mutation prototype)
Parameter
Name Description
prototype Mutation
Returns
Type Description
Mutation.Builder

parseDelimitedFrom(InputStream input)

public static Mutation parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Mutation
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Mutation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Mutation
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Mutation parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Mutation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Mutation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Mutation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Mutation parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Mutation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Mutation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Mutation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Mutation parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Mutation
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Mutation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Mutation
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Mutation parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Mutation
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Mutation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Mutation
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Mutation parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Mutation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Mutation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Mutation
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Mutation> parser()
Returns
Type Description
Parser<Mutation>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public Mutation getDefaultInstanceForType()
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
Mutation.WriteOrBuilder

getOperationCase()

public Mutation.OperationCase getOperationCase()
Returns
Type Description
Mutation.OperationCase

getParserForType()

public Parser<Mutation> getParserForType()
Returns
Type Description
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
Type Description
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
Type Description
Mutation.WriteOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
boolean

Whether the update field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Mutation.Builder newBuilderForType()
Returns
Type Description
Mutation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Mutation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Mutation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Mutation.Builder toBuilder()
Returns
Type Description
Mutation.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException