{"record":{"id":"b3a65ddb73fa0811","repo":"hibernate/hibernate-orm","slug":"unknown-entity-name","errorCode":null,"errorMessage":"Unknown entity name '{}'","messagePattern":"Unknown entity name '(.+?)'","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/BasicValueBinder.java","lineNumber":1491,"sourceCode":"\n\t\t@Override\n\t\tpublic String getReferencedEntityName() {\n\t\t\treturn referencedEntityName;\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean isInPrimaryKey() {\n\t\t\t// @MapsId is not itself in the primary key,\n\t\t\t// so it's safe to simply process it after all the primary keys have been processed.\n\t\t\treturn true;\n\t\t}\n\n\t\t@Override\n\t\tpublic void doSecondPass(Map<String, PersistentClass> persistentClasses) {\n\t\t\tfinal var referencedEntity = persistentClasses.get( referencedEntityName );\n\t\t\tif ( referencedEntity == null ) {\n\t\t\t\t// TODO: much better error message if this is something that can really happen!\n\t\t\t\tthrow new AnnotationException( \"Unknown entity name '\" + referencedEntityName + \"'\" );\n\t\t\t}\n\t\t\tlinkJoinColumnWithValueOverridingNameIfImplicit(\n\t\t\t\t\treferencedEntity,\n\t\t\t\t\treferencedEntity.getKey(),\n\t\t\t\t\tjoinColumns,\n\t\t\t\t\tvalue\n\t\t\t);\n\t\t}\n\t}\n}\n","sourceCodeStart":1473,"sourceCodeEnd":1502,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/BasicValueBinder.java#L1473-L1502","documentation":"Error \"Unknown entity name '{}'\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An association or reference targets a type that Hibernate has not mapped as an entity.","commonSituations":"Missing @Entity on the target class, the class not being scanned into the persistence unit, or a typo in the entity name.","solutions":["Correct the entity name to one that is registered in the persistence unit.","If a custom entity name is used, make sure it matches the name declared in @Entity(name=...)."],"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"}