{"record":{"id":"6ec199d4ef23a7d9","repo":"hibernate/hibernate-orm","slug":"no-result-found-for-query-getquerystring","errorCode":null,"errorMessage":"No result found for query [\" + getQueryString() + \"]","messagePattern":"No result found for query \\[\" \\+ getQueryString\\(\\) \\+ \"\\]","errorType":"exception","errorClass":"NoResultException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java","lineNumber":1392,"sourceCode":"\t\t}\n\t}\n\n\t@Override\n\t@Nullable\n\tpublic <R1> R1 getSingleResult(@Nonnull jakarta.persistence.sql.ResultSetMapping<R1> resultSetMapping) {\n\t\tcheckNotClosed();\n\t\ttry {\n\t\t\tfinal var list = getResultList( resultSetMapping );\n\t\t\treturn list == null ? null : getSingleResult( list );\n\t\t}\n\t\tcatch ( HibernateException e ) {\n\t\t\tthrow getExceptionConverter().convert( e, getQueryOptions().getLockOptions() );\n\t\t}\n\t}\n\n\tprivate <R1> R1 getSingleResult(List<R1> results) {\n\t\tif ( results.isEmpty() ) {\n\t\t\tthrow new NoResultException( \"No result found for query [\" + getQueryString() + \"]\" );\n\t\t}\n\t\treturn uniqueElement( results );\n\t}\n\n\t@Override\n\t@Nullable\n\tpublic <R1> R1 getSingleResultOrNull(@Nonnull Class<R1> aClass) {\n\t\tcheckNotClosed();\n\t\ttry {\n\t\t\tfinal var list = getResultList( aClass );\n\t\t\treturn list == null ? null : uniqueElement( list );\n\t\t}\n\t\tcatch ( HibernateException e ) {\n\t\t\tthrow getExceptionConverter().convert( e, getQueryOptions().getLockOptions() );\n\t\t}\n\t}\n\n\t@Override","sourceCodeStart":1374,"sourceCodeEnd":1410,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java#L1374-L1410","documentation":"Error \"No result found for query [\" + getQueryString() + \"]\" 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":["Use getResultList() and handle the empty case instead of getSingleResult().","Verify the procedure/query actually returns a row for the given parameters."],"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"}