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<Customer> findCustomerByName(String customerName) {
return customers.recordView(Customer.class).query(null, columnValue("name", equalTo(customerName)));
}
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<C> voidaccept(CriteriaVisitor<C> v, C context) Accept the visitor with the given context.static Expressionand(Expression... expressions) Creates theandof the expressions.static ExpressioncolumnValue(String columnName, Condition condition) Creates a predicate that tests whether the column value is equal to the given condition.static ConditionequalTo(byte[] value) Creates a condition that test the examined object is equal to the specifiedvalue.static <T> ConditionequalTo(Comparable<T> value) Creates a condition that test the examined object is equal to the specifiedvalue.static <T> ConditiongreaterThan(Comparable<T> value) Creates a condition that test the examined object is greater than the specifiedvalue.static <T> ConditiongreaterThanOrEqualTo(Comparable<T> value) Creates a condition that test the examined object is greater than or equal than the specifiedvalue.static Conditionin(byte[]... values) Creates a condition that test the examined object is is found within the specifiedcollection.static <T> Conditionin(Comparable<T>... values) Creates a condition that test the examined object is is found within the specifiedcollection.static <T> ConditionlessThan(Comparable<T> value) Creates a condition that test the examined object is less than the specifiedvalue.static <T> ConditionlessThanOrEqualTo(Comparable<T> value) Creates a condition that test the examined object is less than or equal than the specifiedvalue.static Expressionnot(Expression expression) Creates the negation of the predicate.static ConditionnotEqualTo(byte[] value) Creates a condition that test the examined object is not equal to the specifiedvalue.static <T> ConditionnotEqualTo(Comparable<T> value) Creates a condition that test the examined object is not equal to the specifiedvalue.static ConditionnotIn(byte[]... values) Creates a condition that test the examined object is is not found within the specifiedcollection.static <T> ConditionnotIn(Comparable<T>... values) Creates a condition that test the examined object is is not found within the specifiedcollection.static ConditionCreates a condition that test the examined object is not null.static ConditionCreates a condition that test the examined object is null.static Expressionor(Expression... expressions) Creates theorof 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 theandof the expressions.For example:
and(columnValue("category", equalTo("toys")), columnValue("quantity", lessThan(20)))- Parameters:
expressions- Expressions.- Returns:
- The created
andexpression instance.
-
or
Creates theorof the expressions.For example:
or(columnValue("category", equalTo("toys")), columnValue("category", equalTo("games")))- Parameters:
expressions- Expressions.- Returns:
- The created
orexpressions 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.
-