{"record":{"id":"3df7bcb1bbc16d6f","repo":"hibernate/hibernate-orm","slug":"unknown-entity-name-referencedentityname","errorCode":null,"errorMessage":"Unknown entity name '<referencedEntityName>'","messagePattern":"Unknown entity name '<referencedEntityName>'","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/EmbeddableBinder.java","lineNumber":1248,"sourceCode":"\t\t\t\t\t\tindex,\n\t\t\t\t\t\treferencedProperty\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn createSimpleProperty(\n\t\t\t\t\t\treferencedPersistentClass,\n\t\t\t\t\t\tisExplicitReference,\n\t\t\t\t\t\tcolumnByReferencedName,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t\treferencedProperty\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tprivate Component getReferencedComponent(PersistentClass referencedPersistentClass) {\n\t\t\tif ( referencedPersistentClass == 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\tif ( referencedPersistentClass.getIdentifier() instanceof Component id ) {\n\t\t\t\treturn id;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// The entity with the @MapsId annotation has a composite\n\t\t\t\t// id type, but the referenced entity has a basic-typed id.\n\t\t\t\t// Therefore, the @MapsId annotation should have specified\n\t\t\t\t// a property of the composite id that has the foreign key\n\t\t\t\tthrow new AnnotationException(\n\t\t\t\t\t\t\"Missing 'value' in '@MapsId' annotation of association '\" + propertyName\n\t\t\t\t\t\t+ \"' of entity '\" + embeddable.getOwner().getEntityName()\n\t\t\t\t\t\t+ \"' with composite identifier type\"\n\t\t\t\t\t\t+ \" ('@MapsId' must specify a property of the '@EmbeddedId' class which has the foreign key of '\"\n\t\t\t\t\t\t+ referencedEntityName + \"')\"\n\t\t\t\t);\n\t\t\t}\n\t\t}","sourceCodeStart":1230,"sourceCodeEnd":1266,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/EmbeddableBinder.java#L1230-L1266","documentation":"Error \"Unknown entity name '<referencedEntityName>'\" 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 referenced entity name to a registered entity of the persistence unit."],"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"}