Skip to content

Commit

Permalink
Upgraded to the new API by spring data 2.2 (#21)
Browse files Browse the repository at this point in the history
* Upgraded to spring boot 2.2.0
* ignore .idea folder for IntelliJ
  • Loading branch information
bonifacechacha authored and Artur- committed Nov 20, 2019
1 parent 171f445 commit 2ff5e71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.settings
.project
.classpath
.idea
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<vaadin.version>14.0.5</vaadin.version>
<vaadin.version>14.0.8</vaadin.version>

<!-- ZIP Manifest fields -->
<Implementation-Version>${project.version}</Implementation-Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ protected abstract Page<T> fetchFromBackEnd(Query<T, F> query,
private Pageable getPageable(Query<T, F> q) {
Pair<Integer, Integer> pageSizeAndNumber = limitAndOffsetToPageSizeAndNumber(
q.getOffset(), q.getLimit());
return new PageRequest(pageSizeAndNumber.getSecond(),
pageSizeAndNumber.getFirst(), createSpringSort(q));
return PageRequest.of(pageSizeAndNumber.getSecond(), pageSizeAndNumber.getFirst(), createSpringSort(q));
}

private <T, F> Sort createSpringSort(Query<T, F> q) {
Expand All @@ -50,7 +49,7 @@ private <T, F> Sort createSpringSort(Query<T, F> q) {
if (orders.isEmpty()) {
return Sort.unsorted();
} else {
return new Sort(orders);
return Sort.by(orders);
}
}

Expand Down

0 comments on commit 2ff5e71

Please sign in to comment.