public interface OngoingWhereClause<SelfT extends OngoingWhereClause<SelfT>>
Modifier and Type | Method and Description |
---|---|
SelfT |
where(Iterable<Relation> additionalRelations)
Adds multiple relations at once.
|
default SelfT |
where(Relation... additionalRelations)
Var-arg equivalent of
where(Iterable) . |
SelfT |
where(Relation relation)
Adds a relation in the WHERE clause.
|
default ColumnRelationBuilder<SelfT> |
whereColumn(CqlIdentifier id)
Adds a relation testing a column.
|
default ColumnRelationBuilder<SelfT> |
whereColumn(String name)
Shortcut for
whereColumn(CqlIdentifier.fromCql(name)) . |
default MultiColumnRelationBuilder<SelfT> |
whereColumnIds(Iterable<CqlIdentifier> identifiers)
Adds a multi-column relation, as in
WHERE (c1, c2, c3) IN ... . |
default MultiColumnRelationBuilder<SelfT> |
whereColumns(CqlIdentifier... identifiers)
Var-arg equivalent of
whereColumnIds(Iterable) . |
default MultiColumnRelationBuilder<SelfT> |
whereColumns(Iterable<String> names)
Equivalent of
whereColumnIds(Iterable) with raw strings; the names are converted with
CqlIdentifier.fromCql(String) . |
default MultiColumnRelationBuilder<SelfT> |
whereColumns(String... names)
Var-arg equivalent of
whereColumns(Iterable) . |
default SelfT |
whereCustomIndex(CqlIdentifier indexId,
Term expression)
Adds a relation on a custom index.
|
default SelfT |
whereCustomIndex(String indexName,
Term expression)
|
default ColumnComponentRelationBuilder<SelfT> |
whereMapValue(CqlIdentifier columnId,
Term index)
Adds a relation testing a value in a map (Cassandra 4 and above).
|
default ColumnComponentRelationBuilder<SelfT> |
whereMapValue(String columnName,
Term index)
Shortcut for
whereMapValue(CqlIdentifier.fromCql(columnName), index) . |
default SelfT |
whereRaw(String raw)
Adds a raw CQL snippet as a relation.
|
default TokenRelationBuilder<SelfT> |
whereToken(CqlIdentifier... identifiers)
Var-arg equivalent of
whereTokenFromIds(Iterable) . |
default TokenRelationBuilder<SelfT> |
whereToken(Iterable<String> names)
Equivalent of
whereTokenFromIds(Iterable) with raw strings; the names are converted
with CqlIdentifier.fromCql(String) . |
default TokenRelationBuilder<SelfT> |
whereToken(String... names)
Var-arg equivalent of
whereToken(Iterable) . |
default TokenRelationBuilder<SelfT> |
whereTokenFromIds(Iterable<CqlIdentifier> identifiers)
Adds a relation testing a token generated from a set of columns.
|
@NonNull @CheckReturnValue SelfT where(@NonNull Relation relation)
To create the argument, use one of the factory methods in Relation
, for example
column
.
If you add multiple selectors as once, consider where(Iterable)
as a more efficient
alternative.
@NonNull @CheckReturnValue SelfT where(@NonNull Iterable<Relation> additionalRelations)
This is slightly more efficient than adding the relations one by one (since the underlying implementation of this object is immutable).
To create the arguments, use one of the factory methods in Relation
, for example
column
.
where(Relation)
@NonNull @CheckReturnValue default SelfT where(@NonNull Relation... additionalRelations)
where(Iterable)
.@NonNull default ColumnRelationBuilder<SelfT> whereColumn(@NonNull CqlIdentifier id)
This must be chained with an operator call, for example:
selectFrom("foo").all().whereColumn("k").isEqualTo(bindMarker());
This is the equivalent of creating a relation with Relation.column(CqlIdentifier)
and
passing it to where(Relation)
.@NonNull default ColumnRelationBuilder<SelfT> whereColumn(@NonNull String name)
whereColumn(CqlIdentifier.fromCql(name))
.
This is the equivalent of creating a relation with Relation.column(String)
and
passing it to where(Relation)
.
@NonNull default ColumnComponentRelationBuilder<SelfT> whereMapValue(@NonNull CqlIdentifier columnId, @NonNull Term index)
This is the equivalent of creating a relation with Relation.mapValue(CqlIdentifier,
Term)
and passing it to where(Relation)
.
@NonNull default ColumnComponentRelationBuilder<SelfT> whereMapValue(@NonNull String columnName, @NonNull Term index)
whereMapValue(CqlIdentifier.fromCql(columnName), index)
.
This is the equivalent of creating a relation with Relation.mapValue(String, Term)
and passing it to where(Relation)
.
@NonNull default TokenRelationBuilder<SelfT> whereTokenFromIds(@NonNull Iterable<CqlIdentifier> identifiers)
This is the equivalent of creating a relation with Relation.tokenFromIds(Iterable)
and passing it to where(Relation)
.
@NonNull default TokenRelationBuilder<SelfT> whereToken(@NonNull CqlIdentifier... identifiers)
whereTokenFromIds(Iterable)
.
This is the equivalent of creating a relation with Relation.token(CqlIdentifier...)
and passing it to where(Relation)
.
@NonNull default TokenRelationBuilder<SelfT> whereToken(@NonNull Iterable<String> names)
whereTokenFromIds(Iterable)
with raw strings; the names are converted
with CqlIdentifier.fromCql(String)
.
This is the equivalent of creating a relation with Relation.token(Iterable)
and
passing it to where(Relation)
.
@NonNull default TokenRelationBuilder<SelfT> whereToken(@NonNull String... names)
whereToken(Iterable)
.
This is the equivalent of creating a relation with Relation.token(String...)
and
passing it to where(Relation)
.
@NonNull default MultiColumnRelationBuilder<SelfT> whereColumnIds(@NonNull Iterable<CqlIdentifier> identifiers)
WHERE (c1, c2, c3) IN ...
.
This is the equivalent of creating a relation with Relation.columnIds(Iterable)
and
passing it to where(Relation)
.
@NonNull default MultiColumnRelationBuilder<SelfT> whereColumns(@NonNull CqlIdentifier... identifiers)
whereColumnIds(Iterable)
.
This is the equivalent of creating a relation with Relation.columns(CqlIdentifier...)
and passing it to where(Relation)
.
@NonNull default MultiColumnRelationBuilder<SelfT> whereColumns(@NonNull Iterable<String> names)
whereColumnIds(Iterable)
with raw strings; the names are converted with
CqlIdentifier.fromCql(String)
.
This is the equivalent of creating a relation with Relation.columns(Iterable)
and
passing it to where(Relation)
.
@NonNull default MultiColumnRelationBuilder<SelfT> whereColumns(@NonNull String... names)
whereColumns(Iterable)
.
This is the equivalent of creating a relation with Relation.columns(String...)
and
passing it to where(Relation)
.
@NonNull @CheckReturnValue default SelfT whereCustomIndex(@NonNull CqlIdentifier indexId, @NonNull Term expression)
This is the equivalent of creating a relation with Relation.customIndex(CqlIdentifier, Term)
and passing it to where(Relation)
.
@NonNull @CheckReturnValue default SelfT whereCustomIndex(@NonNull String indexName, @NonNull Term expression)
whereCustomIndex(CqlIdentifier.fromCql(indexName), expression)
.
This is the equivalent of creating a relation with Relation.customIndex(String,
Term)
and passing it to where(Relation)
.
@NonNull @CheckReturnValue default SelfT whereRaw(@NonNull String raw)
This is the equivalent of creating a relation with QueryBuilder.raw(String)
and
passing it to where(Relation)
.
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.
Copyright © 2017–2019. All rights reserved.