use of jakarta.nosql.SortType in project jnosql-diana by eclipse.
the class FindByMethodQueryProvider method sort.
private Sort sort(MethodParser.OrderNameContext context) {
String text = context.variable().getText();
SortType type = context.desc() == null ? SortType.ASC : SortType.DESC;
return Sort.of(getFormatField(text), type);
}
use of jakarta.nosql.SortType in project jnosql-diana by eclipse.
the class AntlrSelectQueryProvider method sort.
private Sort sort(QueryParser.OrderNameContext context) {
String text = context.name().getText();
SortType type = context.desc() == null ? SortType.ASC : SortType.DESC;
return Sort.of(text, type);
}
use of jakarta.nosql.SortType in project jnosql-diana by eclipse.
the class FindByMethodQueryProviderTest method shouldReturnParserQuery21.
@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "findByOrderByNameAsc" })
public void shouldReturnParserQuery21(String query) {
SortType type = SortType.ASC;
checkOrderBy(query, type);
}
use of jakarta.nosql.SortType in project jnosql-diana by eclipse.
the class FindByMethodQueryProviderTest method shouldReturnParserQuery23.
@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "findByOrderByNameDescAgeAsc" })
public void shouldReturnParserQuery23(String query) {
SortType type = SortType.DESC;
SortType type2 = SortType.ASC;
checkOrderBy(query, type, type2);
}
Aggregations