Class Update
java.lang.Object
org.springframework.data.cassandra.core.query.Update
Update object representing a set of update operations.
Update
objects can be created in a fluent
style. Each construction operation creates a new immutable Update
object.
Update update = Update.empty().set("foo", "bar").addTo("baz").prependAll(listOfValues);
- Since:
- 2.0
- Author:
- Mark Paluch, Chema Vinacua
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Builder to add a single element/multiple elements to a collection associated with aColumnName
.static class
Add element(s) to Map operation.static class
Add element(s) to collection operation.static class
Abstract class for an update assignment related to a specificColumnName
.static class
Increment operation.static interface
Builder to remove a single element/multiple elements from a collection associated with aColumnName
.static class
Remove operation.static class
Set at index operation.static class
Set at map key operation.static interface
Builder to associate a single value with a collection at a given index atColumnName
.static class
Set operation.static interface
Builder to associate a single value with a collection at a given index atColumnName
. -
Method Summary
Modifier and TypeMethodDescriptionCreate a newUpdate.AddToBuilder
to add items to a collection forcolumnName
in a fluent style.Cleat the collection atcolumnName
.Decrement the value atcolumnName
by 1.Decrement the value atcolumnName
bydelta
.static Update
empty()
Create an emptyUpdate
object.Increment the value atcolumnName
by 1.Increment the value atcolumnName
bydelta
.static Update
of
(Iterable<Update.AssignmentOp> assignmentOps) Create aUpdate
object given a list ofUpdate.AssignmentOp
s.Removevalue
from the collection atcolumnName
.removeFrom
(String columnName) Create a newUpdate.RemoveFromBuilder
to remove items from a collection forcolumnName
in a fluent style.Create a newUpdate.SetBuilder
to set a collection item forcolumnName
in a fluent style.Set thecolumnName
tovalue
.toString()
static Update
Set thecolumnName
tovalue
.
-
Method Details
-
empty
Create an emptyUpdate
object.- Returns:
- a new, empty
Update
.
-
of
Create aUpdate
object given a list ofUpdate.AssignmentOp
s.- Parameters:
assignmentOps
- must not be null.
-
update
Set thecolumnName
tovalue
.- Returns:
- a new
Update
.
-
set
Set thecolumnName
tovalue
.- Parameters:
columnName
- must not be null.value
- value to set on column with name, may be null.- Returns:
- a new
Update
object containing the merge result of the existing assignments and the current assignment.
-
set
Create a newUpdate.SetBuilder
to set a collection item forcolumnName
in a fluent style.- Parameters:
columnName
- must not be null.- Returns:
- a new
Update.AddToBuilder
to build an set assignment.
-
addTo
Create a newUpdate.AddToBuilder
to add items to a collection forcolumnName
in a fluent style.- Parameters:
columnName
- must not be null.- Returns:
- a new
Update.AddToBuilder
to build an add-to assignment.
-
removeFrom
Create a newUpdate.RemoveFromBuilder
to remove items from a collection forcolumnName
in a fluent style.- Parameters:
columnName
- must not be null.- Returns:
- a new
Update.RemoveFromBuilder
to build an remove-from assignment. - Since:
- 3.1.4
-
remove
Removevalue
from the collection atcolumnName
.- Parameters:
columnName
- must not be null.value
- must not be null.- Returns:
- a new
Update
object containing the merge result of the existing assignments and the current assignment.
-
clear
Cleat the collection atcolumnName
.- Parameters:
columnName
- must not be null.- Returns:
- a new
Update
object containing the merge result of the existing assignments and the current assignment.
-
increment
Increment the value atcolumnName
by 1.- Parameters:
columnName
- must not be null.- Returns:
- a new
Update
object containing the merge result of the existing assignments and the current assignment.
-
increment
Increment the value atcolumnName
bydelta
.- Parameters:
columnName
- must not be null.delta
- increment value.- Returns:
- a new
Update
object containing the merge result of the existing assignments and the current assignment.
-
decrement
Decrement the value atcolumnName
by 1.- Parameters:
columnName
- must not be null.- Returns:
- a new
Update
object containing the merge result of the existing assignments and the current assignment.
-
decrement
Decrement the value atcolumnName
bydelta
.- Parameters:
columnName
- must not be null.delta
- decrement value.- Returns:
- a new
Update
object containing the merge result of the existing assignments and the current assignment.
-
getUpdateOperations
- Returns:
Collection
of update operations.
-
toString
-