Class Mutation.Builder (6.55.0)

public static final class Mutation.Builder extends GeneratedMessageV3.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Mutation.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Mutation.Builder
Overrides

build()

public Mutation build()
Returns
TypeDescription
Mutation

buildPartial()

public Mutation buildPartial()
Returns
TypeDescription
Mutation

clear()

public Mutation.Builder clear()
Returns
TypeDescription
Mutation.Builder
Overrides

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

clearField(Descriptors.FieldDescriptor field)

public Mutation.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Mutation.Builder
Overrides

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

clearOneof(Descriptors.OneofDescriptor oneof)

public Mutation.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Mutation.Builder
Overrides

clearOperation()

public Mutation.Builder clearOperation()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
Mutation.Builder

clone()

public Mutation.Builder clone()
Returns
TypeDescription
Mutation.Builder
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.

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
TypeDescription
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
TypeDescription
Mutation.DeleteOrBuilder

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
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.

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
TypeDescription
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
TypeDescription
Mutation.WriteOrBuilder

getOperationCase()

public Mutation.OperationCase getOperationCase()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
Mutation.WriteOrBuilder

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.

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

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

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
NameDescription
valueMutation.Delete
Returns
TypeDescription
Mutation.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Mutation.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Mutation.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Mutation.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Mutation.Builder
Overrides

mergeFrom(Mutation other)

public Mutation.Builder mergeFrom(Mutation other)
Parameter
NameDescription
otherMutation
Returns
TypeDescription
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
NameDescription
valueMutation.Write
Returns
TypeDescription
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
NameDescription
valueMutation.Write
Returns
TypeDescription
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
NameDescription
valueMutation.Write
Returns
TypeDescription
Mutation.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Mutation.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Mutation.Builder
Overrides

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
NameDescription
valueMutation.Write
Returns
TypeDescription
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
NameDescription
valueMutation.Delete
Returns
TypeDescription
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
NameDescription
builderForValueMutation.Delete.Builder
Returns
TypeDescription
Mutation.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Mutation.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Mutation.Builder
Overrides

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
NameDescription
valueMutation.Write
Returns
TypeDescription
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
NameDescription
builderForValueMutation.Write.Builder
Returns
TypeDescription
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
NameDescription
valueMutation.Write
Returns
TypeDescription
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
NameDescription
builderForValueMutation.Write.Builder
Returns
TypeDescription
Mutation.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Mutation.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Mutation.Builder
Overrides

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
NameDescription
valueMutation.Write
Returns
TypeDescription
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
NameDescription
builderForValueMutation.Write.Builder
Returns
TypeDescription
Mutation.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final Mutation.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Mutation.Builder
Overrides

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
NameDescription
valueMutation.Write
Returns
TypeDescription
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
NameDescription
builderForValueMutation.Write.Builder
Returns
TypeDescription
Mutation.Builder