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
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
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()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static Mutation.Builder newBuilder()
newBuilder(Mutation prototype)
public static Mutation.Builder newBuilder(Mutation prototype)
Parameter |
Name |
Description |
prototype |
Mutation
|
public static Mutation parseDelimitedFrom(InputStream input)
public static Mutation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static Mutation parseFrom(byte[] data)
Parameter |
Name |
Description |
data |
byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Mutation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static Mutation parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Mutation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Mutation parseFrom(CodedInputStream input)
public static Mutation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static Mutation parseFrom(InputStream input)
public static Mutation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static Mutation parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Mutation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<Mutation> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
Name |
Description |
obj |
Object
|
Overrides
getDefaultInstanceForType()
public Mutation getDefaultInstanceForType()
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;
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;
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;
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;
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;
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;
getOperationCase()
public Mutation.OperationCase getOperationCase()
getParserForType()
public Parser<Mutation> getParserForType()
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;
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;
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;
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;
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 |
Type |
Description |
int |
|
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public Mutation.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Mutation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Returns |
Type |
Description |
Object |
|
Overrides
toBuilder()
public Mutation.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides