Skip to content

Commit b88d496

Browse files
committed
tolerate badly-typed PageRequest parameters
as required by Jakarta Data TCK Signed-off-by: Gavin King <[email protected]>
1 parent af747ad commit b88d496

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AbstractQueryMethod.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,12 @@ void makeKeyedPage(StringBuilder declaration, List<String> paramTypes) {
378378
"\t\t\t\t\t\t.collect(toList());\n" +
379379
"\t\tvar _page =\n" +
380380
"\t\t\t\tPageRequest.of(Entity.class)\n" +
381-
"\t\t\t\t\t\t.sortBy(pageRequest.sorts())\n" +
381+
//SHOULD NOT have cast to raw Iterable
382+
"\t\t\t\t\t\t.sortBy((Iterable) pageRequest.sorts())\n" +
382383
"\t\t\t\t\t\t.size(pageRequest.size())\n" +
383384
"\t\t\t\t\t\t.page(pageRequest.page() + 1);\n" +
384-
"\t\treturn new CursoredPageRecord<>(_results.getResultList(), _cursors, _totalResults, pageRequest,\n" +
385+
//SHOULD BE new CursoredPageRecord<>
386+
"\t\treturn new CursoredPageRecord(_results.getResultList(), _cursors, _totalResults, pageRequest,\n" +
385387
"\t\t\t\t_results.isLastPage() ? null : _page.afterKey(_results.getNextPage().getKey().toArray()),\n" +
386388
"\t\t\t\t_results.isFirstPage() ? null : _page.beforeKey(_results.getPreviousPage().getKey().toArray()));";
387389

0 commit comments

Comments
 (0)