{"record":{"id":"f6d59fc56d09b276","repo":"hibernate/hibernate-orm","slug":"unable-to-find-attribute-s-s","errorCode":null,"errorMessage":"Unable to find attribute %s -> %s","messagePattern":"Unable to find attribute (.+?) -> (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java","lineNumber":894,"sourceCode":"\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treferencedPropertyName = null;\n\t\t}\n\n\t\tif ( referencedPropertyName != null  ) {\n\t\t\tif ( referencedPropertyName.indexOf( '.' ) > 0 ) {\n\t\t\t\treturn interpretNestedToOneKeyDescriptor(\n\t\t\t\t\t\treferencedEntityDescriptor,\n\t\t\t\t\t\treferencedPropertyName,\n\t\t\t\t\t\tattributeMapping,\n\t\t\t\t\t\tcreationProcess\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tfinal var modelPart = referencedEntityDescriptor.findByPath( referencedPropertyName );\n\t\t\tif ( modelPart == null ) {\n\t\t\t\tthrow new IllegalArgumentException( \"Unable to find attribute \" + bootProperty.getPersistentClass()\n\t\t\t\t\t\t.getEntityName() + \" -> \" + bootProperty.getName() );\n\t\t\t}\n\t\t\telse if ( modelPart instanceof ToOneAttributeMapping toOneAttributeMapping ) {\n\t\t\t\tsetReferencedAttributeForeignKeyDescriptor(\n\t\t\t\t\t\tattributeMapping,\n\t\t\t\t\t\ttoOneAttributeMapping,\n\t\t\t\t\t\treferencedEntityDescriptor,\n\t\t\t\t\t\treferencedPropertyName,\n\t\t\t\t\t\tcreationProcess\n\t\t\t\t);\n\t\t\t}\n\t\t\telse if ( modelPart instanceof EmbeddableValuedModelPart embeddableValuedModelPart ) {\n\t\t\t\tfinal var embeddedForeignKeyDescriptor = buildEmbeddableForeignKeyDescriptor(\n\t\t\t\t\t\tgetPropertyPath( attributeMapping.getNavigableRole() ),\n\t\t\t\t\t\tembeddableValuedModelPart,\n\t\t\t\t\t\tbootValueMapping,\n\t\t\t\t\t\tattributeMapping.getDeclaringType(),\n\t\t\t\t\t\tattributeMapping.findContainingEntityMapping(),","sourceCodeStart":876,"sourceCodeEnd":912,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java#L876-L912","documentation":"Error \"Unable to find attribute %s -> %s\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when a referenced attribute cannot be found on the target embeddable or entity while building a foreign key mapping.","commonSituations":"See trigger scenarios.","solutions":["Verify the referenced attribute path exists on the target entity/embeddable; fix the referencedPropertyName or mappedBy value."],"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"}