{"record":{"id":"24b7df2a2b9ae0c0","repo":"hibernate/hibernate-orm","slug":"no-row-with-the-given-identifier-exists-24b7df","errorCode":null,"errorMessage":"No row with the given identifier exists","messagePattern":"No row with the given identifier exists","errorType":"exception","errorClass":"ObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/loader/ast/internal/EntityConcreteTypeLoader.java","lineNumber":89,"sourceCode":"\n\t\tfinal var jdbcSelect =\n\t\t\t\tjdbcServices.getJdbcEnvironment().getSqlAstTranslatorFactory()\n\t\t\t\t\t\t.buildSelectTranslator( factory, sqlSelect )\n\t\t\t\t\t\t.translate( bindings, QueryOptions.NONE );\n\t\tfinal var results =\n\t\t\t\tjdbcServices.getJdbcSelectExecutor()\n\t\t\t\t\t\t.list(\n\t\t\t\t\t\t\t\tjdbcSelect,\n\t\t\t\t\t\t\t\tbindings,\n\t\t\t\t\t\t\t\tnew BaseExecutionContext( session ),\n\t\t\t\t\t\t\t\tRowTransformerStandardImpl.instance(),\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\tListResultsConsumer.UniqueSemantic.NONE,\n\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\n\t\tif ( results.isEmpty() ) {\n\t\t\tthrow new ObjectNotFoundException( entityDescriptor.getEntityName(), id );\n\t\t}\n\t\telse {\n\t\t\tassert results.size() == 1;\n\t\t\tfinal Object result = results.get( 0 );\n\t\t\tfinal var mappingMetamodel = factory.getMappingMetamodel();\n\t\t\tfinal var concreteType =\n\t\t\t\t\tresult instanceof Class<?> concreteClass\n\t\t\t\t\t\t\t? mappingMetamodel.getEntityDescriptor( concreteClass )\n\t\t\t\t\t\t\t: mappingMetamodel.getEntityDescriptor( (String) result );\n\t\t\tif ( !concreteType.isTypeOrSuperType( entityDescriptor ) ) {\n\t\t\t\tthrow new WrongClassException(\n\t\t\t\t\t\tconcreteType.getEntityName(),\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tentityDescriptor.getEntityName(),\n\t\t\t\t\t\tresult\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn concreteType;","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/loader/ast/internal/EntityConcreteTypeLoader.java#L71-L107","documentation":"Error \"No row with the given identifier exists\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/loader/ast/internal/EntityConcreteTypeLoader.java:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the id exists in the database; handle ObjectNotFoundException or use find() which returns null instead."],"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"}