Package org.apache.ignite.table.criteria
Interface Criteria
- All Known Implementing Classes:
Column
,Expression
,Parameter
public interface Criteria
Represents a criteria query predicate.
public ClosableCursor<Product> uncategorizedProducts() {
return products.recordView(Product.class).queryCriteria(null, columnValue("category", nullValue()));
}
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<C> void
accept
(CriteriaVisitor<C> v, C context) Accept the visitor with the given context.static Expression
and
(Expression... expressions) Creates theand
of the expressions.static Expression
columnValue
(String columnName, Condition condition) Creates a predicate that tests whether the column value is equal to the given condition.static Condition
equalTo
(byte[] value) Creates a condition that test the examined object is equal to the specifiedvalue
.static <T> Condition
equalTo
(Comparable<T> value) Creates a condition that test the examined object is equal to the specifiedvalue
.static <T> Condition
greaterThan
(Comparable<T> value) Creates a condition that test the examined object is greater than the specifiedvalue
.static <T> Condition
greaterThanOrEqualTo
(Comparable<T> value) Creates a condition that test the examined object is greater than or equal than the specifiedvalue
.static Condition
in
(byte[]... values) Creates a condition that test the examined object is is found within the specifiedcollection
.static <T> Condition
in
(Comparable<T>... values) Creates a condition that test the examined object is is found within the specifiedcollection
.static <T> Condition
lessThan
(Comparable<T> value) Creates a condition that test the examined object is less than the specifiedvalue
.static <T> Condition
lessThanOrEqualTo
(Comparable<T> value) Creates a condition that test the examined object is less than or equal than the specifiedvalue
.static Expression
not
(Expression expression) Creates the negation of the predicate.static Condition
notEqualTo
(byte[] value) Creates a condition that test the examined object is not equal to the specifiedvalue
.static <T> Condition
notEqualTo
(Comparable<T> value) Creates a condition that test the examined object is not equal to the specifiedvalue
.static Condition
notIn
(byte[]... values) Creates a condition that test the examined object is is not found within the specifiedcollection
.static <T> Condition
notIn
(Comparable<T>... values) Creates a condition that test the examined object is is not found within the specifiedcollection
.static Condition
Creates a condition that test the examined object is not null.static Condition
Creates a condition that test the examined object is null.static Expression
or
(Expression... expressions) Creates theor
of the expressions.
-
Method Details
-
accept
Accept the visitor with the given context.- Type Parameters:
C
- Context type.- Parameters:
v
- Visitor.context
- Context of visit.
-
columnValue
Creates a predicate that tests whether the column value is equal to the given condition.For example:
columnValue("category", equalTo("toys")) columnValue(IgniteNameUtils.quoteIfNeeded("subCategory"), equalTo("puzzle"))
- Parameters:
columnName
- Column name must use SQL-parser style notation; e.g.,
"myColumn", creates a predicate for the column ignores case sensitivity,
"\"MyColumn\"", creates a predicate for the column with respect to case sensitivity.condition
- Target condition.- Returns:
- The created expression instance.
-
not
Creates the negation of the predicate.For example:
not(columnValue("category", equalTo("toys")))
- Parameters:
expression
- Expression.- Returns:
- The created negation of the expression.
-
and
Creates theand
of the expressions.For example:
and(columnValue("category", equalTo("toys")), columnValue("quantity", lessThan(20)))
- Parameters:
expressions
- Expressions.- Returns:
- The created
and
expression instance.
-
or
Creates theor
of the expressions.For example:
or(columnValue("category", equalTo("toys")), columnValue("category", equalTo("games")))
- Parameters:
expressions
- Expressions.- Returns:
- The created
or
expressions instance.
-
equalTo
Creates a condition that test the examined object is equal to the specifiedvalue
.For example:
columnValue("category", equalTo("toys"))
- Type Parameters:
T
- Value type.- Parameters:
value
- Target value.
-
equalTo
Creates a condition that test the examined object is equal to the specifiedvalue
.For example:
columnValue("password", equalTo("MyPassword".getBytes()))
- Parameters:
value
- Target value.
-
notEqualTo
Creates a condition that test the examined object is not equal to the specifiedvalue
.For example:
columnValue("category", notEqualTo("toys"))
- Type Parameters:
T
- Value type.- Parameters:
value
- Target value.
-
notEqualTo
Creates a condition that test the examined object is not equal to the specifiedvalue
.For example:
columnValue("password", notEqualTo("MyPassword".getBytes()))
- Parameters:
value
- Target value.
-
greaterThan
Creates a condition that test the examined object is greater than the specifiedvalue
.For example:
columnValue("age", greaterThan(35))
- Type Parameters:
T
- Value type.- Parameters:
value
- Target value.
-
greaterThanOrEqualTo
Creates a condition that test the examined object is greater than or equal than the specifiedvalue
.For example:
columnValue("age", greaterThanOrEqualTo(35))
- Type Parameters:
T
- Value type.- Parameters:
value
- Target value.
-
lessThan
Creates a condition that test the examined object is less than the specifiedvalue
.For example:
columnValue("age", lessThan(35))
- Type Parameters:
T
- Value type.- Parameters:
value
- Target value.
-
lessThanOrEqualTo
Creates a condition that test the examined object is less than or equal than the specifiedvalue
.For example:
columnValue("age", lessThanOrEqualTo(35))
- Type Parameters:
T
- Value type.- Parameters:
value
- Target value.
-
nullValue
Creates a condition that test the examined object is null.For example:
columnValue("category", nullValue())
-
notNullValue
Creates a condition that test the examined object is not null.For example:
columnValue("category", notNullValue())
-
in
Creates a condition that test the examined object is is found within the specifiedcollection
.For example:
columnValue("category", in("toys", "games"))
- Type Parameters:
T
- Values type.- Parameters:
values
- The collection in which matching items must be found.
-
in
Creates a condition that test the examined object is is found within the specifiedcollection
.For example:
columnValue("password", in("MyPassword".getBytes(), "MyOtherPassword".getBytes()))
- Parameters:
values
- The collection in which matching items must be found.
-
notIn
Creates a condition that test the examined object is is not found within the specifiedcollection
.For example:
columnValue("category", notIn("toys", "games"))
- Type Parameters:
T
- Values type.- Parameters:
values
- The collection in which matching items must be not found.
-
notIn
Creates a condition that test the examined object is is not found within the specifiedcollection
.For example:
columnValue("password", notIn("MyPassword".getBytes(), "MyOtherPassword".getBytes()))
- Parameters:
values
- The collection in which matching items must be not found.
-