{"record":{"id":"d3c57ebef983cba3","repo":"hibernate/hibernate-orm","slug":"page-size-must-be-strictly-positive","errorCode":null,"errorMessage":"page size must be strictly positive","messagePattern":"page size must be strictly positive","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/Page.java","lineNumber":90,"sourceCode":"\t * @return the page {@linkplain #size}, that is, the\n\t *         {@linkplain SelectionQuery#getMaxResults()\n\t *         maximum number of results} on the page.\n\t */\n\tpublic int getMaxResults() {\n\t\treturn size;\n\t}\n\n\t/**\n\t * @return the {@linkplain SelectionQuery#getFirstResult()\n\t *         offset} of this page.\n\t */\n\tpublic int getFirstResult() {\n\t\treturn size*number;\n\t}\n\n\tPage(int size, int number) {\n\t\tif ( size <= 0 ) {\n\t\t\tthrow new IllegalArgumentException(\"page size must be strictly positive\");\n\t\t}\n\t\tif ( number < 0 ) {\n\t\t\tthrow new IllegalArgumentException(\"page number must be non-negative\");\n\t\t}\n\t\tthis.size = size;\n\t\tthis.number = number;\n\t}\n\n\t/**\n\t * Obtain a page, numbered from {@code 0}, with the given size.\n\t * @param size the number of results on the initial page.\n\t * @param number the number of the page, where {@code 0} is the first page.\n\t */\n\tpublic static Page page(int size, int number) {\n\t\treturn new Page( size, number );\n\t}\n\n\t/**","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/Page.java#L72-L108","documentation":"Error \"page size must be strictly positive\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A runtime precondition of the Hibernate API is violated.","commonSituations":"Occurs when application code or configuration does not satisfy the documented contract of the API being called.","solutions":["Pass a page size greater than zero.","Validate pagination parameters before building the Page."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}