public interface OngoingAssignment
Modifier and Type | Method and Description |
---|---|
default UpdateWithAssignments |
append(CqlIdentifier columnId,
Term suffix)
Appends to a collection column, as in
SET l=l+? . |
default UpdateWithAssignments |
append(String columnName,
Term suffix)
Shortcut for
append(CqlIdentifier.fromCql(columnName),
suffix) . |
default UpdateWithAssignments |
appendListElement(CqlIdentifier columnId,
Term suffix)
Appends a single element to a list column, as in
SET l=l+[?] . |
default UpdateWithAssignments |
appendListElement(String columnName,
Term suffix)
|
default UpdateWithAssignments |
appendMapEntry(CqlIdentifier columnId,
Term key,
Term value)
Appends a single entry to a map column, as in
SET m=m+{?:?} . |
default UpdateWithAssignments |
appendMapEntry(String columnName,
Term key,
Term value)
|
default UpdateWithAssignments |
appendSetElement(CqlIdentifier columnId,
Term suffix)
Appends a single element to a set column, as in
SET s=s+{?} . |
default UpdateWithAssignments |
appendSetElement(String columnName,
Term suffix)
|
default UpdateWithAssignments |
decrement(CqlIdentifier columnId)
Decrements a counter by 1, as in
SET c-=1 . |
default UpdateWithAssignments |
decrement(CqlIdentifier columnId,
Term amount)
Decrements a counter, as in
SET c-=? . |
default UpdateWithAssignments |
decrement(String columnName)
Shortcut for
CqlIdentifier.fromCql(columnName) . |
default UpdateWithAssignments |
decrement(String columnName,
Term amount)
Shortcut for
decrement(CqlIdentifier.fromCql(columnName), amount) |
default UpdateWithAssignments |
increment(CqlIdentifier columnId)
Increments a counter by 1, as in
SET c+=1 . |
default UpdateWithAssignments |
increment(CqlIdentifier columnId,
Term amount)
Increments a counter, as in
SET c+=? . |
default UpdateWithAssignments |
increment(String columnName)
Shortcut for
CqlIdentifier.fromCql(columnName) . |
default UpdateWithAssignments |
increment(String columnName,
Term amount)
Shortcut for
increment(CqlIdentifier.fromCql(columnName), amount) |
default UpdateWithAssignments |
prepend(CqlIdentifier columnId,
Term prefix)
Prepends to a collection column, as in
SET l=[1,2,3]+l . |
default UpdateWithAssignments |
prepend(String columnName,
Term prefix)
Shortcut for
prepend(CqlIdentifier.fromCql(columnName),
prefix) . |
default UpdateWithAssignments |
prependListElement(CqlIdentifier columnId,
Term suffix)
Prepends a single element to a list column, as in
SET l=[?]+l . |
default UpdateWithAssignments |
prependListElement(String columnName,
Term suffix)
|
default UpdateWithAssignments |
prependMapEntry(CqlIdentifier columnId,
Term key,
Term value)
Prepends a single entry to a map column, as in
SET m={?:?}+m . |
default UpdateWithAssignments |
prependMapEntry(String columnName,
Term key,
Term value)
|
default UpdateWithAssignments |
prependSetElement(CqlIdentifier columnId,
Term suffix)
Prepends a single element to a set column, as in
SET s={?}+s . |
default UpdateWithAssignments |
prependSetElement(String columnName,
Term suffix)
|
default UpdateWithAssignments |
remove(CqlIdentifier columnId,
Term collectionToRemove)
Removes elements from a collection, as in
SET l=l-[1,2,3] . |
default UpdateWithAssignments |
remove(String columnName,
Term collectionToRemove)
|
default UpdateWithAssignments |
removeListElement(CqlIdentifier columnId,
Term suffix)
Removes a single element to a list column, as in
SET l=l-[?] . |
default UpdateWithAssignments |
removeListElement(String columnName,
Term suffix)
|
default UpdateWithAssignments |
removeMapEntry(CqlIdentifier columnId,
Term key,
Term value)
Removes a single entry to a map column, as in
SET m=m-{?:?} . |
default UpdateWithAssignments |
removeMapEntry(String columnName,
Term key,
Term value)
|
default UpdateWithAssignments |
removeSetElement(CqlIdentifier columnId,
Term suffix)
Removes a single element to a set column, as in
SET s=s-{?} . |
default UpdateWithAssignments |
removeSetElement(String columnName,
Term suffix)
|
default UpdateWithAssignments |
set(Assignment... assignments)
Var-arg equivalent of
set(Iterable) . |
UpdateWithAssignments |
set(Assignment assignment)
Adds an assignment to this statement, as in
UPDATE foo SET v=1 . |
UpdateWithAssignments |
set(Iterable<Assignment> additionalAssignments)
Adds multiple assignments at once.
|
default UpdateWithAssignments |
setColumn(CqlIdentifier columnId,
Term value)
Assigns a value to a column, as in
SET c=1 . |
default UpdateWithAssignments |
setColumn(String columnName,
Term value)
Shortcut for
setColumn(CqlIdentifier.fromCql(columnName), value) . |
default UpdateWithAssignments |
setField(CqlIdentifier columnId,
CqlIdentifier fieldId,
Term value)
Assigns a value to a field of a UDT, as in
SET address.zip=? . |
default UpdateWithAssignments |
setField(String columnName,
String fieldName,
Term value)
|
default UpdateWithAssignments |
setListValue(CqlIdentifier columnId,
Term index,
Term value)
Assigns a value to an index in a list column, as in
SET list[?]=? . |
default UpdateWithAssignments |
setListValue(String columnName,
Term index,
Term value)
|
default UpdateWithAssignments |
setMapValue(CqlIdentifier columnId,
Term key,
Term value)
Assigns a value to an entry in a map column, as in
SET map[?]=? . |
default UpdateWithAssignments |
setMapValue(String columnName,
Term key,
Term value)
|
@NonNull UpdateWithAssignments set(@NonNull Assignment assignment)
UPDATE foo SET v=1
.
To create the argument, use one of the factory methods in Assignment
, for example
AssignmentsetColumn(CqlIdentifier, Term)
. This type also provides shortcuts to create
and add the assignment in one call, for example setColumn(CqlIdentifier, Term)
.
If you add multiple assignments as one, consider set(Iterable)
as a more efficient
alternative.
@NonNull UpdateWithAssignments set(@NonNull Iterable<Assignment> additionalAssignments)
This is slightly more efficient than adding the assignments one by one (since the underlying implementation of this object is immutable).
To create the argument, use one of the factory methods in Assignment
, for example
AssignmentsetColumn(CqlIdentifier, Term)
.
@NonNull default UpdateWithAssignments set(@NonNull Assignment... assignments)
set(Iterable)
.@NonNull default UpdateWithAssignments setColumn(@NonNull CqlIdentifier columnId, @NonNull Term value)
SET c=1
.
This is a shortcut for set(Assignment.setColumn(columnId, value))
.
@NonNull default UpdateWithAssignments setColumn(@NonNull String columnName, @NonNull Term value)
setColumn(CqlIdentifier.fromCql(columnName), value)
.Assignment.setColumn(String, Term)
@NonNull default UpdateWithAssignments setField(@NonNull CqlIdentifier columnId, @NonNull CqlIdentifier fieldId, @NonNull Term value)
SET address.zip=?
.
This is a shortcut for set(Assignment.setField(columnId, fieldId,
value))
.
@NonNull default UpdateWithAssignments setField(@NonNull String columnName, @NonNull String fieldName, @NonNull Term value)
@NonNull default UpdateWithAssignments setMapValue(@NonNull CqlIdentifier columnId, @NonNull Term key, @NonNull Term value)
SET map[?]=?
.
This is a shortcut for set(Assignment.setMapValue(columnId, key,
value))
.
@NonNull default UpdateWithAssignments setMapValue(@NonNull String columnName, @NonNull Term key, @NonNull Term value)
@NonNull default UpdateWithAssignments setListValue(@NonNull CqlIdentifier columnId, @NonNull Term index, @NonNull Term value)
SET list[?]=?
.
This is a shortcut for set(Assignment.setListValue(columnId, index,
value))
.
@NonNull default UpdateWithAssignments setListValue(@NonNull String columnName, @NonNull Term index, @NonNull Term value)
@NonNull default UpdateWithAssignments increment(@NonNull CqlIdentifier columnId, @NonNull Term amount)
SET c+=?
.
This is a shortcut for set(Assignment.increment(columnId, amount))
.
@NonNull default UpdateWithAssignments increment(@NonNull String columnName, @NonNull Term amount)
increment(CqlIdentifier.fromCql(columnName), amount)
Assignment.increment(String, Term)
@NonNull default UpdateWithAssignments increment(@NonNull CqlIdentifier columnId)
SET c+=1
.
This is a shortcut for increment(CqlIdentifier, Term)
increment(columnId,
QueryBuilder.literal(1))}.
Assignment.increment(CqlIdentifier)
@NonNull default UpdateWithAssignments increment(@NonNull String columnName)
CqlIdentifier.fromCql(columnName)
.Assignment.increment(CqlIdentifier)
@NonNull default UpdateWithAssignments decrement(@NonNull CqlIdentifier columnId, @NonNull Term amount)
SET c-=?
.
This is a shortcut for set(Assignment.decrement(columnId, amount))
.
@NonNull default UpdateWithAssignments decrement(@NonNull String columnName, @NonNull Term amount)
decrement(CqlIdentifier.fromCql(columnName), amount)
Assignment.decrement(String, Term)
@NonNull default UpdateWithAssignments decrement(@NonNull CqlIdentifier columnId)
SET c-=1
.
This is a shortcut for decrement(CqlIdentifier, Term)
decrement(columnId, 1)}.
Assignment.decrement(CqlIdentifier)
@NonNull default UpdateWithAssignments decrement(@NonNull String columnName)
CqlIdentifier.fromCql(columnName)
.Assignment.decrement(String)
@NonNull default UpdateWithAssignments append(@NonNull CqlIdentifier columnId, @NonNull Term suffix)
SET l=l+?
.
The term must be a collection of the same type as the column.
This is a shortcut for set(Assignment.append(columnId, suffix))
.
Assignment.append(CqlIdentifier, Term)
@NonNull default UpdateWithAssignments append(@NonNull String columnName, @NonNull Term suffix)
append(CqlIdentifier.fromCql(columnName),
suffix)
.Assignment.append(String, Term)
@NonNull default UpdateWithAssignments appendListElement(@NonNull CqlIdentifier columnId, @NonNull Term suffix)
SET l=l+[?]
.
The term must be of the same type as the column's elements.
This is a shortcut for set(Assignment.appendListElement(columnId,
suffix))
.
@NonNull default UpdateWithAssignments appendListElement(@NonNull String columnName, @NonNull Term suffix)
@NonNull default UpdateWithAssignments appendSetElement(@NonNull CqlIdentifier columnId, @NonNull Term suffix)
SET s=s+{?}
.
The term must be of the same type as the column's elements.
This is a shortcut for set(Assignment.appendSetElement(columnId,
suffix))
.
@NonNull default UpdateWithAssignments appendSetElement(@NonNull String columnName, @NonNull Term suffix)
@NonNull default UpdateWithAssignments appendMapEntry(@NonNull CqlIdentifier columnId, @NonNull Term key, @NonNull Term value)
SET m=m+{?:?}
.
The terms must be of the same type as the column's keys and values respectively.
This is a shortcut for set(Assignment.appendMapEntry(columnId, key,
value)
.
@NonNull default UpdateWithAssignments appendMapEntry(@NonNull String columnName, @NonNull Term key, @NonNull Term value)
@NonNull default UpdateWithAssignments prepend(@NonNull CqlIdentifier columnId, @NonNull Term prefix)
SET l=[1,2,3]+l
.
The term must be a collection of the same type as the column.
This is a shortcut for set(Assignment.prepend(columnId, prefix))
.
Assignment.prepend(CqlIdentifier, Term)
@NonNull default UpdateWithAssignments prepend(@NonNull String columnName, @NonNull Term prefix)
prepend(CqlIdentifier.fromCql(columnName),
prefix)
.Assignment.prepend(String, Term)
@NonNull default UpdateWithAssignments prependListElement(@NonNull CqlIdentifier columnId, @NonNull Term suffix)
SET l=[?]+l
.
The term must be of the same type as the column's elements.
This is a shortcut for set(Assignment.prependListElement(columnId,
suffix))
.
@NonNull default UpdateWithAssignments prependListElement(@NonNull String columnName, @NonNull Term suffix)
@NonNull default UpdateWithAssignments prependSetElement(@NonNull CqlIdentifier columnId, @NonNull Term suffix)
SET s={?}+s
.
The term must be of the same type as the column's elements.
This is a shortcut for set(Assignment.prependSetElement(columnId,
suffix))
.
@NonNull default UpdateWithAssignments prependSetElement(@NonNull String columnName, @NonNull Term suffix)
@NonNull default UpdateWithAssignments prependMapEntry(@NonNull CqlIdentifier columnId, @NonNull Term key, @NonNull Term value)
SET m={?:?}+m
.
The terms must be of the same type as the column's keys and values respectively.
This is a shortcut for set(Assignment.prependMapEntry(columnId, key,
value))
.
@NonNull default UpdateWithAssignments prependMapEntry(@NonNull String columnName, @NonNull Term key, @NonNull Term value)
@NonNull default UpdateWithAssignments remove(@NonNull CqlIdentifier columnId, @NonNull Term collectionToRemove)
SET l=l-[1,2,3]
.
The term must be a collection of the same type as the column.
DO NOT USE THIS TO DECREMENT COUNTERS. Use the dedicated decrement(CqlIdentifier, Term)
methods instead. While the operator is technically the same,
and it would be possible to generate an expression such as counter-=1
with this method,
a collection removal is idempotent while a counter decrement isn't.
This is a shortcut for set(Assignment.remove(columnId,
collectionToRemove))
.
Assignment.remove(CqlIdentifier, Term)
@NonNull default UpdateWithAssignments remove(@NonNull String columnName, @NonNull Term collectionToRemove)
Assignment.remove(String, Term)
@NonNull default UpdateWithAssignments removeListElement(@NonNull CqlIdentifier columnId, @NonNull Term suffix)
SET l=l-[?]
.
The term must be of the same type as the column's elements.
This is a shortcut for set(Assignment.removeListElement(columnId,
suffix))
.
@NonNull default UpdateWithAssignments removeListElement(@NonNull String columnName, @NonNull Term suffix)
@NonNull default UpdateWithAssignments removeSetElement(@NonNull CqlIdentifier columnId, @NonNull Term suffix)
SET s=s-{?}
.
The term must be of the same type as the column's elements.
This is a shortcut for set(Assignment.removeSetElement(columnId,
suffix))
.
@NonNull default UpdateWithAssignments removeSetElement(@NonNull String columnName, @NonNull Term suffix)
@NonNull default UpdateWithAssignments removeMapEntry(@NonNull CqlIdentifier columnId, @NonNull Term key, @NonNull Term value)
SET m=m-{?:?}
.
The terms must be of the same type as the column's keys and values respectively.
This is a shortcut for set(Assignment.removeMapEntry(columnId, key,
value)
.
@NonNull default UpdateWithAssignments removeMapEntry(@NonNull String columnName, @NonNull Term key, @NonNull Term value)
Copyright © 2017–2021. All rights reserved.