Package com.google.cloud.spanner
Enum Mutation.Op
- All Implemented Interfaces:
Serializable
,Comparable<Mutation.Op>
- Enclosing class:
- Mutation
Enumerates the types of mutation that can be applied.
-
Enum Constant Summary
Enum ConstantDescriptionDeletes rows from a table.Inserts a new row in a table.LikeINSERT
, except that if the row already exists, then its column values are overwritten with the ones provided.LikeINSERT
, except that if the row already exists, it is deleted, and the column values provided are inserted instead.Updates an existing row in a table. -
Method Summary
Modifier and TypeMethodDescriptionstatic Mutation.Op
Returns the enum constant of this type with the specified name.static Mutation.Op[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
INSERT
Inserts a new row in a table. If the row already exists, the write or transaction fails withErrorCode.ALREADY_EXISTS
. When inserting a row, all NOT NULL columns in the table must be given a value. -
UPDATE
Updates an existing row in a table. If the row does not already exist, the transaction fails with errorErrorCode.NOT_FOUND
. -
INSERT_OR_UPDATE
LikeINSERT
, except that if the row already exists, then its column values are overwritten with the ones provided. All NOT NUll columns in the table must be give a value and this holds true even when the row already exists and will actually be updated. Values for all NULL columns not explicitly written are preserved. -
REPLACE
LikeINSERT
, except that if the row already exists, it is deleted, and the column values provided are inserted instead. UnlikeINSERT_OR_UPDATE
, this means any values not explicitly written becomeNULL
. -
DELETE
Deletes rows from a table. Succeeds whether or not the named rows were present.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-