Class Mutation.Builder (6.108.0)

public static final class Mutation.Builder extends GeneratedMessage.Builder<Mutation.Builder> 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 Methods

getDescriptor()

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

Methods

build()

public Mutation build()
Returns
Type Description
Mutation

buildPartial()

public Mutation buildPartial()
Returns
Type Description
Mutation

clear()

public Mutation.Builder clear()
Returns
Type Description
Mutation.Builder
Overrides

clearAck()

public Mutation.Builder clearAck()

Ack a message from a queue.

.google.spanner.v1.Mutation.Ack ack = 7;

Returns
Type Description
Mutation.Builder

clearDelete()

public Mutation.Builder clearDelete()

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.Builder

clearInsert()

public Mutation.Builder clearInsert()

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.Builder

clearInsertOrUpdate()

public Mutation.Builder clearInsertOrUpdate()

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.Builder

clearOperation()

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

clearReplace()

public Mutation.Builder clearReplace()

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.Builder

clearSend()

public Mutation.Builder clearSend()

Send a message to a queue.

.google.spanner.v1.Mutation.Send send = 6;

Returns
Type Description
Mutation.Builder

clearUpdate()

public Mutation.Builder clearUpdate()

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.Builder

getAck()

public Mutation.Ack getAck()

Ack a message from a queue.

.google.spanner.v1.Mutation.Ack ack = 7;

Returns
Type Description
Mutation.Ack

The ack.

getAckBuilder()

public Mutation.Ack.Builder getAckBuilder()

Ack a message from a queue.

.google.spanner.v1.Mutation.Ack ack = 7;

Returns
Type Description
Mutation.Ack.Builder

getAckOrBuilder()

public Mutation.AckOrBuilder getAckOrBuilder()

Ack a message from a queue.

.google.spanner.v1.Mutation.Ack ack = 7;

Returns
Type Description
Mutation.AckOrBuilder

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.

getDeleteBuilder()

public Mutation.Delete.Builder getDeleteBuilder()

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.Builder

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

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

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.

getInsertBuilder()

public Mutation.Write.Builder getInsertBuilder()

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.Builder

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.

getInsertOrUpdateBuilder()

public Mutation.Write.Builder getInsertOrUpdateBuilder()

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.Builder

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

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.

getReplaceBuilder()

public Mutation.Write.Builder getReplaceBuilder()

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.Builder

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

getSend()

public Mutation.Send getSend()

Send a message to a queue.

.google.spanner.v1.Mutation.Send send = 6;

Returns
Type Description
Mutation.Send

The send.

getSendBuilder()

public Mutation.Send.Builder getSendBuilder()

Send a message to a queue.

.google.spanner.v1.Mutation.Send send = 6;

Returns
Type Description
Mutation.Send.Builder

getSendOrBuilder()

public Mutation.SendOrBuilder getSendOrBuilder()

Send a message to a queue.

.google.spanner.v1.Mutation.Send send = 6;

Returns
Type Description
Mutation.SendOrBuilder

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.

getUpdateBuilder()

public Mutation.Write.Builder getUpdateBuilder()

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.Builder

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

hasAck()

public boolean hasAck()

Ack a message from a queue.

.google.spanner.v1.Mutation.Ack ack = 7;

Returns
Type Description
boolean

Whether the ack field is set.

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.

hasSend()

public boolean hasSend()

Send a message to a queue.

.google.spanner.v1.Mutation.Send send = 6;

Returns
Type Description
boolean

Whether the send 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.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeAck(Mutation.Ack value)

public Mutation.Builder mergeAck(Mutation.Ack value)

Ack a message from a queue.

.google.spanner.v1.Mutation.Ack ack = 7;

Parameter
Name Description
value Mutation.Ack
Returns
Type Description
Mutation.Builder

mergeDelete(Mutation.Delete value)

public Mutation.Builder mergeDelete(Mutation.Delete value)

Delete rows from a table. Succeeds whether or not the named rows were present.

.google.spanner.v1.Mutation.Delete delete = 5;

Parameter
Name Description
value Mutation.Delete
Returns
Type Description
Mutation.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Mutation.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Mutation.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Mutation.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Mutation.Builder
Overrides

mergeFrom(Mutation other)

public Mutation.Builder mergeFrom(Mutation other)
Parameter
Name Description
other Mutation
Returns
Type Description
Mutation.Builder

mergeInsert(Mutation.Write value)

public Mutation.Builder mergeInsert(Mutation.Write value)

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;

Parameter
Name Description
value Mutation.Write
Returns
Type Description
Mutation.Builder

mergeInsertOrUpdate(Mutation.Write value)

public Mutation.Builder mergeInsertOrUpdate(Mutation.Write value)

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;

Parameter
Name Description
value Mutation.Write
Returns
Type Description
Mutation.Builder

mergeReplace(Mutation.Write value)

public Mutation.Builder mergeReplace(Mutation.Write value)

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;

Parameter
Name Description
value Mutation.Write
Returns
Type Description
Mutation.Builder

mergeSend(Mutation.Send value)

public Mutation.Builder mergeSend(Mutation.Send value)

Send a message to a queue.

.google.spanner.v1.Mutation.Send send = 6;

Parameter
Name Description
value Mutation.Send
Returns
Type Description
Mutation.Builder

mergeUpdate(Mutation.Write value)

public Mutation.Builder mergeUpdate(Mutation.Write value)

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;

Parameter
Name Description
value Mutation.Write
Returns
Type Description
Mutation.Builder

setAck(Mutation.Ack value)

public Mutation.Builder setAck(Mutation.Ack value)

Ack a message from a queue.

.google.spanner.v1.Mutation.Ack ack = 7;

Parameter
Name Description
value Mutation.Ack
Returns
Type Description
Mutation.Builder

setAck(Mutation.Ack.Builder builderForValue)

public Mutation.Builder setAck(Mutation.Ack.Builder builderForValue)

Ack a message from a queue.

.google.spanner.v1.Mutation.Ack ack = 7;

Parameter
Name Description
builderForValue Mutation.Ack.Builder
Returns
Type Description
Mutation.Builder

setDelete(Mutation.Delete value)

public Mutation.Builder setDelete(Mutation.Delete value)

Delete rows from a table. Succeeds whether or not the named rows were present.

.google.spanner.v1.Mutation.Delete delete = 5;

Parameter
Name Description
value Mutation.Delete
Returns
Type Description
Mutation.Builder

setDelete(Mutation.Delete.Builder builderForValue)

public Mutation.Builder setDelete(Mutation.Delete.Builder builderForValue)

Delete rows from a table. Succeeds whether or not the named rows were present.

.google.spanner.v1.Mutation.Delete delete = 5;

Parameter
Name Description
builderForValue Mutation.Delete.Builder
Returns
Type Description
Mutation.Builder

setInsert(Mutation.Write value)

public Mutation.Builder setInsert(Mutation.Write value)

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;

Parameter
Name Description
value Mutation.Write
Returns
Type Description
Mutation.Builder

setInsert(Mutation.Write.Builder builderForValue)

public Mutation.Builder setInsert(Mutation.Write.Builder builderForValue)

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;

Parameter
Name Description
builderForValue Mutation.Write.Builder
Returns
Type Description
Mutation.Builder

setInsertOrUpdate(Mutation.Write value)

public Mutation.Builder setInsertOrUpdate(Mutation.Write value)

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;

Parameter
Name Description
value Mutation.Write
Returns
Type Description
Mutation.Builder

setInsertOrUpdate(Mutation.Write.Builder builderForValue)

public Mutation.Builder setInsertOrUpdate(Mutation.Write.Builder builderForValue)

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;

Parameter
Name Description
builderForValue Mutation.Write.Builder
Returns
Type Description
Mutation.Builder

setReplace(Mutation.Write value)

public Mutation.Builder setReplace(Mutation.Write value)

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;

Parameter
Name Description
value Mutation.Write
Returns
Type Description
Mutation.Builder

setReplace(Mutation.Write.Builder builderForValue)

public Mutation.Builder setReplace(Mutation.Write.Builder builderForValue)

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;

Parameter
Name Description
builderForValue Mutation.Write.Builder
Returns
Type Description
Mutation.Builder

setSend(Mutation.Send value)

public Mutation.Builder setSend(Mutation.Send value)

Send a message to a queue.

.google.spanner.v1.Mutation.Send send = 6;

Parameter
Name Description
value Mutation.Send
Returns
Type Description
Mutation.Builder

setSend(Mutation.Send.Builder builderForValue)

public Mutation.Builder setSend(Mutation.Send.Builder builderForValue)

Send a message to a queue.

.google.spanner.v1.Mutation.Send send = 6;

Parameter
Name Description
builderForValue Mutation.Send.Builder
Returns
Type Description
Mutation.Builder

setUpdate(Mutation.Write value)

public Mutation.Builder setUpdate(Mutation.Write value)

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;

Parameter
Name Description
value Mutation.Write
Returns
Type Description
Mutation.Builder

setUpdate(Mutation.Write.Builder builderForValue)

public Mutation.Builder setUpdate(Mutation.Write.Builder builderForValue)

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;

Parameter
Name Description
builderForValue Mutation.Write.Builder
Returns
Type Description
Mutation.Builder