Search in sources :

Example 11 with ArrayQueryValue

use of jakarta.nosql.query.ArrayQueryValue in project jnosql-diana by eclipse.

the class AbstractMethodQueryProvider method exitBetween.

@Override
public void exitBetween(MethodParser.BetweenContext ctx) {
    boolean hasNot = Objects.nonNull(ctx.not());
    String variable = getVariable(ctx.variable());
    Operator operator = BETWEEN;
    ArrayQueryValue value = MethodArrayValue.of(variable);
    checkCondition(new MethodCondition(variable, operator, value), hasNot);
}
Also used : Operator(jakarta.nosql.query.Operator) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue)

Example 12 with ArrayQueryValue

use of jakarta.nosql.query.ArrayQueryValue in project jnosql-diana by eclipse.

the class AbstractWhereSupplier method exitIn.

@Override
public void exitIn(QueryParser.InContext ctx) {
    boolean hasNot = Objects.nonNull(ctx.not());
    String name = ctx.name().getText();
    QueryValue<?>[] values = ctx.value().stream().map(ValueConverter::get).toArray(QueryValue[]::new);
    ArrayQueryValue value = DefaultArrayValue.of(values);
    checkCondition(new DefaultCondition(name, IN, value), hasNot);
}
Also used : ConditionQueryValue(jakarta.nosql.query.ConditionQueryValue) QueryValue(jakarta.nosql.query.QueryValue) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue) StringQueryValue(jakarta.nosql.query.StringQueryValue) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue)

Aggregations

ArrayQueryValue (jakarta.nosql.query.ArrayQueryValue)12 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)10 ValueSource (org.junit.jupiter.params.provider.ValueSource)10 Condition (jakarta.nosql.query.Condition)8 Where (jakarta.nosql.query.Where)8 QueryValue (jakarta.nosql.query.QueryValue)5 StringQueryValue (jakarta.nosql.query.StringQueryValue)5 DeleteQuery (jakarta.nosql.query.DeleteQuery)4 NumberQueryValue (jakarta.nosql.query.NumberQueryValue)4 SelectQuery (jakarta.nosql.query.SelectQuery)4 ConditionQueryValue (jakarta.nosql.query.ConditionQueryValue)3 FunctionQueryValue (jakarta.nosql.query.FunctionQueryValue)2 JSONQueryValue (jakarta.nosql.query.JSONQueryValue)2 ParamQueryValue (jakarta.nosql.query.ParamQueryValue)2 DelQuery (jakarta.nosql.query.DelQuery)1 GetQuery (jakarta.nosql.query.GetQuery)1 Operator (jakarta.nosql.query.Operator)1