Skip to content

Commit

Permalink
feat: include mapper to convert to entity
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Jun 13, 2024
1 parent 21fc24e commit 61157c8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
package org.eclipse.jnosql.mapping.semistructured.query;

import jakarta.data.Direction;
import jakarta.data.Order;
import jakarta.data.Sort;
import jakarta.data.page.Page;
Expand Down Expand Up @@ -49,7 +50,10 @@ public Page<T> findAll(PageRequest pageRequest, Order<T> order) {
Objects.requireNonNull(pageRequest, "pageRequest is required");
EntityMetadata metadata = entityMetadata();
List<Sort<?>> sorts = new ArrayList<>();
order.forEach(sorts::add);
order.forEach(sort -> {
Sort<?> sortQuery = Sort.of(metadata.columnField(sort.property()), sort.isAscending() ? Direction.ASC : Direction.DESC, false);
sorts.add(sortQuery);
});
SelectQuery query = new MappingQuery(sorts,
pageRequest.size(), NoSQLPage.skip(pageRequest)
, null ,metadata.name());
Expand Down

0 comments on commit 61157c8

Please sign in to comment.