public interface DeleteSelection extends OngoingWhereClause<Delete>
Modifier and Type | Method and Description |
---|---|
default DeleteSelection |
column(CqlIdentifier columnId)
Deletes a particular column by its CQL identifier.
|
default DeleteSelection |
column(String columnName)
Shortcut for
column(CqlIdentifier.fromCql(columnName)) |
default DeleteSelection |
element(CqlIdentifier collectionId,
Term index)
Deletes an element in a collection column, as in
DELETE m['key'] . |
default DeleteSelection |
element(String collectionName,
Term index)
Shortcut for
element(CqlIdentifier.fromCql(collectionName), index) . |
default DeleteSelection |
field(CqlIdentifier udtColumnId,
CqlIdentifier fieldId)
Deletes a field inside of a UDT column, as in
DELETE user.name . |
default DeleteSelection |
field(String udtColumnName,
String fieldName)
|
default DeleteSelection |
raw(String raw)
Specifies an element to delete as a raw CQL snippet.
|
DeleteSelection |
selector(Selector selector)
Adds a selector.
|
DeleteSelection |
selectors(Iterable<Selector> additionalSelectors)
Adds multiple selectors at once.
|
default DeleteSelection |
selectors(Selector... additionalSelectors)
Var-arg equivalent of
selectors(Iterable) . |
DeleteSelection |
usingTimestamp(BindMarker bindMarker)
Adds a USING TIMESTAMP clause to this statement with a bind marker.
|
DeleteSelection |
usingTimestamp(long timestamp)
Adds a USING TIMESTAMP clause to this statement with a literal value.
|
where, where, where, whereColumn, whereColumn, whereColumnIds, whereColumns, whereColumns, whereColumns, whereCustomIndex, whereCustomIndex, whereMapValue, whereMapValue, whereRaw, whereToken, whereToken, whereToken, whereTokenFromIds
@NonNull DeleteSelection selector(@NonNull Selector selector)
To create the argument, use one of the factory methods in Selector
, for example
column
. This type also provides shortcuts to create and
add the selector in one call, for example column(CqlIdentifier)
for selector(column(...))
.
Note that the only valid arguments for DELETE are a column, a field in a UDT column (nested UDTs are not supported), and an element in a collection column (nested collections are not supported).
If you add multiple selectors as once, consider selectors(Iterable)
as a more
efficient alternative.
@NonNull DeleteSelection selectors(@NonNull Iterable<Selector> additionalSelectors)
This is slightly more efficient than adding the selectors one by one (since the underlying implementation of this object is immutable).
To create the arguments, use one of the factory methods in Selector
, for example
column
.
Note that the only valid arguments for DELETE are a column, a field in a UDT column (nested UDTs are not supported), and an element in a collection column (nested collections are not supported).
selector(Selector)
@NonNull default DeleteSelection selectors(@NonNull Selector... additionalSelectors)
selectors(Iterable)
.@NonNull default DeleteSelection column(@NonNull CqlIdentifier columnId)
This is a shortcut for selector(Selector.column(columnId))
.
Selector.column(CqlIdentifier)
@NonNull default DeleteSelection column(@NonNull String columnName)
column(CqlIdentifier.fromCql(columnName))
@NonNull default DeleteSelection field(@NonNull CqlIdentifier udtColumnId, @NonNull CqlIdentifier fieldId)
DELETE user.name
.
This is a shortcut for selector(Selector.field(udtColumnId,
fieldId))
.
@NonNull default DeleteSelection field(@NonNull String udtColumnName, @NonNull String fieldName)
Selector.field(String, String)
@NonNull default DeleteSelection element(@NonNull CqlIdentifier collectionId, @NonNull Term index)
DELETE m['key']
.
This is a shortcut for selector(Selector.element(collectionId,
index))
.
Selector.element(CqlIdentifier, Term)
@NonNull default DeleteSelection element(@NonNull String collectionName, @NonNull Term index)
element(CqlIdentifier.fromCql(collectionName), index)
.Selector.element(String, Term)
@NonNull default DeleteSelection raw(@NonNull String raw)
This is a shortcut for selector(QueryBuilder.raw(raw))
.
The contents will be appended to the query as-is, without any syntax checking or escaping. This method should be used with caution, as it's possible to generate invalid CQL that will fail at execution time; on the other hand, it can be used as a workaround to handle new CQL features that are not yet covered by the query builder.
QueryBuilder.raw(String)
@NonNull DeleteSelection usingTimestamp(long timestamp)
If this method or usingTimestamp(BindMarker)
is called multiple times, the last
value is used.
@NonNull DeleteSelection usingTimestamp(@Nullable BindMarker bindMarker)
If this method or usingTimestamp(long)
is called multiple times, the last value is
used. Passing null
to this method removes any previous timestamp.
Copyright © 2017–2023. All rights reserved.