{"record":{"id":"69c00b1fd7ab3e3e","repo":"quarkusio/quarkus","slug":"cursor-based-pagination-is-not-supported-by-hibern","errorCode":null,"errorMessage":"Cursor-based pagination is not supported by Hibernate Reactive","messagePattern":"Cursor-based pagination is not supported by Hibernate Reactive","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"extensions/data/hibernate/runtime/src/main/java/io/quarkus/data/hibernate/runtime/hr/PanacheManagedReactiveQueryImpl.java","lineNumber":93,"sourceCode":"            return PageRequest.ofPage(page.index + 1, page.size, false);\n        }\n\n        @Override\n        public ReactiveDataQuery<Entity> request(PageRequest request) {\n            // FIXME: let's hope they fix their page indices to 0-based\n            delegate.page((int) (request.page() - 1), request.size());\n            return PanacheManagedReactiveQueryImpl.this;\n        }\n\n        @Override\n        public ReactiveDataQuery<Entity> page(long pageIndex, int pageSize) {\n            delegate.page((int) pageIndex, pageSize);\n            return PanacheManagedReactiveQueryImpl.this;\n        }\n\n        @Override\n        public ReactiveDataQuery<Entity> cursor(long pageIndex, int pageSize) {\n            throw new UnsupportedOperationException(\"Cursor-based pagination is not supported by Hibernate Reactive\");\n        }\n\n        @Override\n        public ReactiveDataQuery<Entity> next() {\n            delegate.nextPage();\n            return PanacheManagedReactiveQueryImpl.this;\n        }\n\n        @Override\n        public ReactiveDataQuery<Entity> previous() {\n            delegate.previousPage();\n            return PanacheManagedReactiveQueryImpl.this;\n        }\n\n        @Override\n        public ReactiveDataQuery<Entity> first() {\n            delegate.firstPage();\n            return PanacheManagedReactiveQueryImpl.this;","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/data/hibernate/runtime/src/main/java/io/quarkus/data/hibernate/runtime/hr/PanacheManagedReactiveQueryImpl.java#L75-L111","documentation":"PanacheManagedReactiveQueryImpl.cursor(pageIndex, pageSize) — offset/size based cursor pagination — is not implemented for the Hibernate Reactive backing, which only offers page(pageIndex, pageSize) plus nextPage() iteration. Calling cursor throws UnsupportedOperationException unconditionally.","triggerScenarios":"Calling cursor(pageIndex, pageSize) on a reactive managed Panache query, typically to combine an explicit offset with paging.","commonSituations":"Code ported from the blocking Panache query API that uses cursor(); frameworks or helpers that map keyset/offset pagination to cursor(pageIndex, pageSize).","solutions":["Use page(pageIndex, pageSize) instead, and navigate with next()/nextPage() for subsequent pages","Compute the absolute page number yourself and pass it to page()","If true cursor/keyset pagination is needed, use an explicit order-by + where id > :lastId query"],"exampleFix":"// before\nquery.cursor(pageIndex, pageSize).list();\n// after\nquery.page(pageIndex, pageSize).list(); // subsequent pages: query.nextPage().list()","handlingStrategy":"fallback","validationCode":"// no pre-check possible; cursor() always throws — avoid calling it on reactive queries","typeGuard":"boolean supportsCursorPagination(Object q) { return !(q instanceof PanacheManagedReactiveQueryImpl); }","tryCatchPattern":"try { q.cursor(idx, size); } catch (UnsupportedOperationException e) { q.page(idx, size); }","preventionTips":["Use page()/nextPage() for all Hibernate Reactive queries","Search the codebase for .cursor( and migrate call sites to page()","Implement keyset pagination manually when offsets are unsuitable"],"tags":["panache","pagination","cursor","hibernate-reactive"],"backgroundTag":"unsupported-pagination-mode","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}