{"record":{"id":"0b8859818e86fba1","repo":"hibernate/hibernate-orm","slug":"property-propertypath-not-found-on-entit-0b8859","errorCode":null,"errorMessage":"property [\" + propertyPath + \"] not found on entity [\" + getEntityName() + \"]","messagePattern":"property \\[\" \\+ propertyPath \\+ \"\\] not found on entity \\[\" \\+ getEntityName\\(\\) \\+ \"\\]","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/mapping/PersistentClass.java","lineNumber":557,"sourceCode":"\t * @throws MappingException If the property could not be found.\n\t */\n\tpublic Property getReferencedProperty(String propertyPath) throws MappingException {\n\t\ttry {\n\t\t\treturn getRecursiveProperty( propertyPath, getReferenceableProperties() );\n\t\t}\n\t\tcatch ( MappingException e ) {\n\t\t\tthrow new MappingException(\n\t\t\t\t\t\"property-ref [\" + propertyPath + \"] not found on entity [\" + getEntityName() + \"]\", e\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic Property getRecursiveProperty(String propertyPath) throws MappingException {\n\t\ttry {\n\t\t\treturn getRecursiveProperty( propertyPath, getPropertyClosure() );\n\t\t}\n\t\tcatch ( MappingException e ) {\n\t\t\tthrow new MappingException(\n\t\t\t\t\t\"property [\" + propertyPath + \"] not found on entity [\" + getEntityName() + \"]\", e\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate Property getRecursiveProperty(String propertyPath, List<Property> properties) throws MappingException {\n\t\tProperty property = null;\n\t\tvar tokens = new StringTokenizer( propertyPath, \".\", false );\n\t\ttry {\n\t\t\twhile ( tokens.hasMoreElements() ) {\n\t\t\t\tfinal String element = (String) tokens.nextElement();\n\t\t\t\tif ( property == null ) {\n\t\t\t\t\tProperty identifierProperty = getIdentifierProperty();\n\t\t\t\t\tif ( identifierProperty != null && identifierProperty.getName().equals( element ) ) {\n\t\t\t\t\t\t// we have a mapped identifier property and the root of\n\t\t\t\t\t\t// the incoming property path matched that identifier\n\t\t\t\t\t\t// property\n\t\t\t\t\t\tproperty = identifierProperty;","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/mapping/PersistentClass.java#L539-L575","documentation":"Thrown when Hibernate fails to resolve a dotted property path against an entity's full property closure. PersistentClass.getRecursiveProperty(path) tokenizes the path on dots and walks the properties, descending into components; if any segment cannot be found, the lookup MappingException is wrapped with this message. It surfaces during binding of references such as property-ref paths that traverse embeddables.","triggerScenarios":"A dotted path like address.city where address is not a component/embeddable; a typo in any segment of the path; the property exists only on a subclass but the lookup ran against a class whose closure does not include it.","commonSituations":"Renaming embedded fields; switching an association between embeddable and entity without updating paths; hand-edited XML holding stale paths.","solutions":["Check each segment of the path against the mapped property names, starting with the first","Ensure intermediate segments are components (@Embeddable), because the resolver only descends into Component values","Update stale paths in property-ref or key mappings after field renames"],"exampleFix":"// before\n<many-to-one name=\"customer\" class=\"Customer\" property-ref=\"homeAddresss.zip\"/>\n\n// after\n<many-to-one name=\"customer\" class=\"Customer\" property-ref=\"homeAddress.zip\"/>","handlingStrategy":"validation","validationCode":"static boolean pathResolvable(PersistentClass pc, String path) {\n    Property cur = null;\n    var tokens = new java.util.StringTokenizer(path, \".\");\n    try {\n        while (tokens.hasMoreTokens()) {\n            String seg = tokens.nextToken();\n            cur = (cur == null) ? pc.getProperty(seg)\n                                : ((Component) cur.getValue()).getProperty(seg);\n        }\n        return true;\n    }\n    catch (Exception e) {\n        return false;\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate every configured dotted path against the entity metadata during application startup","Keep embedded field names stable, or update all path references in the same commit"],"tags":["hibernate","orm","property-path","mapping","embeddable"],"backgroundTag":"unknown-property-reference","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}