use of jakarta.nosql.mapping.Page in project jnosql-diana by eclipse.
the class AbstractGraphRepositoryProxy method converter.
private Object converter(Method method, Class<?> typeClass, Supplier<Stream<?>> querySupplier, Object[] args) {
Supplier<Optional<?>> singleSupplier = DynamicReturn.toSingleResult(method).apply(querySupplier);
Function<Pagination, Page<?>> pageFunction = p -> {
throw new DynamicQueryException("Graph database repository does not support Page as return Type");
};
DynamicReturn<?> dynamicReturn = DynamicReturn.builder().withClassSource(typeClass).withMethodSource(method).withResult(querySupplier).withSingleResult(singleSupplier).withPagination(DynamicReturn.findPagination(args)).withStreamPagination(p -> querySupplier.get()).withSingleResultPagination(p -> singleSupplier.get()).withPage(pageFunction).build();
return dynamicReturn.execute();
}
Aggregations