Modifier and Type | Method and Description |
---|---|
default SelfT |
if_(Condition... conditions)
Var-arg equivalent of
if_(Iterable) . |
SelfT |
if_(Condition condition)
Adds an IF condition.
|
SelfT |
if_(Iterable<Condition> conditions)
Adds multiple IF conditions at once.
|
default ConditionBuilder<SelfT> |
ifColumn(CqlIdentifier columnId)
Adds an IF condition on a simple column, as in {@code DELETE...
|
default ConditionBuilder<SelfT> |
ifColumn(String columnName)
Shortcut for
column(CqlIdentifier.fromCql(columnName)) . |
default ConditionBuilder<SelfT> |
ifElement(CqlIdentifier columnId,
Term index)
Adds an IF condition on an element in a collection column for a conditional statement, as in
{@code DELETE...
|
default ConditionBuilder<SelfT> |
ifElement(String columnName,
Term index)
Shortcut for
element(CqlIdentifier.fromCql(columnName),
index) . |
SelfT |
ifExists()
Adds an IF EXISTS condition.
|
default ConditionBuilder<SelfT> |
ifField(CqlIdentifier columnId,
CqlIdentifier fieldId)
Adds an IF condition on a field in a UDT column for a conditional statement, as in {@code
DELETE...
|
default ConditionBuilder<SelfT> |
ifField(String columnName,
String fieldName)
|
default SelfT |
ifRaw(String raw)
Adds a raw CQL snippet as a condition.
|
@NonNull @CheckReturnValue SelfT ifExists()
If any column conditions were added before, they will be cleared.
@NonNull @CheckReturnValue SelfT if_(@NonNull Condition condition)
ifExists()
was
invoked on this statement before, it will get cancelled.
To create the argument, use one of the factory methods in Condition
, for example
column
.
If you add multiple conditions as once, consider if_(Iterable)
as a more efficient
alternative.
@NonNull @CheckReturnValue SelfT if_(@NonNull Iterable<Condition> conditions)
ifExists()
was invoked on this statement before, it will get cancelled.
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 Condition
, for example
column
.
@NonNull @CheckReturnValue default SelfT if_(@NonNull Condition... conditions)
if_(Iterable)
.@NonNull default ConditionBuilder<SelfT> ifColumn(@NonNull CqlIdentifier columnId)
DELETE... IF k=1
.
This is the equivalent of creating a condition with Condition.column(CqlIdentifier)
and passing it to if_(Condition)
.
@NonNull default ConditionBuilder<SelfT> ifColumn(@NonNull String columnName)
column(CqlIdentifier.fromCql(columnName))
.
This is the equivalent of creating a condition with Condition.column(String)
and
passing it to if_(Condition)
.
@NonNull default ConditionBuilder<SelfT> ifField(@NonNull CqlIdentifier columnId, @NonNull CqlIdentifier fieldId)
DELETE... IF address.street='test'
.
This is the equivalent of creating a condition with Condition.field(CqlIdentifier,
CqlIdentifier)
and passing it to if_(Condition)
.
@NonNull default ConditionBuilder<SelfT> ifField(@NonNull String columnName, @NonNull String fieldName)
field(CqlIdentifier.fromCql(columnName), CqlIdentifier.fromCql(fieldName))
.
This is the equivalent of creating a condition with Condition.field(String, String)
and passing it to if_(Condition)
.
@NonNull default ConditionBuilder<SelfT> ifElement(@NonNull CqlIdentifier columnId, @NonNull Term index)
DELETE... IF m[0]=1
.
This is the equivalent of creating a condition with Condition.element(CqlIdentifier,
Term)
and passing it to if_(Condition)
.
@NonNull default ConditionBuilder<SelfT> ifElement(@NonNull String columnName, @NonNull Term index)
element(CqlIdentifier.fromCql(columnName),
index)
.
This is the equivalent of creating a condition with Condition.element(String, Term)
and passing it to if_(Condition)
.
@NonNull @CheckReturnValue default SelfT ifRaw(@NonNull String raw)
This is the equivalent of creating a condition with QueryBuilder.raw(String)
and
passing it to if_(Condition)
.
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)
Copyright © 2017–2023. All rights reserved.