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
Fields
DELETE_FIELD_NUMBER
public static final int DELETE_FIELD_NUMBER
Field Value
INSERT_FIELD_NUMBER
public static final int INSERT_FIELD_NUMBER
Field Value
INSERT_OR_UPDATE_FIELD_NUMBER
public static final int INSERT_OR_UPDATE_FIELD_NUMBER
Field Value
REPLACE_FIELD_NUMBER
public static final int REPLACE_FIELD_NUMBER
Field Value
UPDATE_FIELD_NUMBER
public static final int UPDATE_FIELD_NUMBER
Field Value
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getDefaultInstance()
public static Mutation getDefaultInstance()
Returns
getDefaultInstanceForType()
public Mutation getDefaultInstanceForType()
Returns
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
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
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
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
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
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
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
getOperationCase()
public Mutation.OperationCase getOperationCase()
Returns
getParserForType()
public Parser<Mutation> getParserForType()
Returns
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
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
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
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
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
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()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilder()
public static Mutation.Builder newBuilder()
Returns
newBuilder(Mutation prototype)
public static Mutation.Builder newBuilder(Mutation prototype)
Parameter
Returns
newBuilderForType()
public Mutation.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Mutation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
public static Mutation parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static Mutation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static Mutation parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Mutation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static Mutation parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Mutation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Mutation parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static Mutation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Mutation parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static Mutation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static Mutation parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Mutation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<Mutation> parser()
Returns
toBuilder()
public Mutation.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions