use of jakarta.nosql.query.Operator in project jnosql-diana by eclipse.
the class DeleteByMethodQueryProviderTest method shouldReturnParserQuery11.
@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "deleteByAgeNotLessThanEqual" })
public void shouldReturnParserQuery11(String query) {
Operator operator = Operator.LESSER_EQUALS_THAN;
String variable = "age";
checkNotCondition(query, operator, variable);
}
use of jakarta.nosql.query.Operator in project jnosql-diana by eclipse.
the class DeleteByMethodQueryProviderTest method shouldReturnParserQuery16.
@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "deleteByAgeAndName" })
public void shouldReturnParserQuery16(String query) {
Operator operator = Operator.EQUALS;
Operator operator2 = Operator.EQUALS;
String variable = "age";
String variable2 = "name";
Operator operatorAppender = Operator.AND;
checkAppendCondition(query, operator, operator2, variable, variable2, operatorAppender);
}
use of jakarta.nosql.query.Operator in project jnosql-diana by eclipse.
the class DeleteByMethodQueryProviderTest method shouldReturnParserQuery12.
@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "deleteByAgeLike" })
public void shouldReturnParserQuery12(String query) {
Operator operator = Operator.LIKE;
String variable = "age";
checkCondition(query, operator, variable);
}
use of jakarta.nosql.query.Operator in project jnosql-diana by eclipse.
the class DeleteByMethodQueryProviderTest method shouldReturnParserQuery7.
@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "deleteByAgeNotGreaterThanEqual" })
public void shouldReturnParserQuery7(String query) {
Operator operator = Operator.GREATER_EQUALS_THAN;
String variable = "age";
checkNotCondition(query, operator, variable);
}
use of jakarta.nosql.query.Operator in project jnosql-diana by eclipse.
the class DeleteByMethodQueryProviderTest method shouldReturnParserQuery27.
@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "deleteByAgeBetween" })
public void shouldReturnParserQuery27(String query) {
Operator operator = Operator.BETWEEN;
String entity = "entity";
DeleteQuery deleteQuery = queryProvider.apply(query, entity);
assertNotNull(deleteQuery);
assertEquals(entity, deleteQuery.getEntity());
assertTrue(deleteQuery.getFields().isEmpty());
Optional<Where> where = deleteQuery.getWhere();
assertTrue(where.isPresent());
Condition condition = where.get().getCondition();
QueryValue<?> value = condition.getValue();
assertEquals(operator, condition.getOperator());
QueryValue<?>[] values = MethodArrayValue.class.cast(value).get();
ParamQueryValue param1 = (ParamQueryValue) values[0];
ParamQueryValue param2 = (ParamQueryValue) values[1];
assertNotEquals(param2.get(), param1.get());
}
Aggregations