{"record":{"id":"e5f51f3d5ddfa83d","repo":"hibernate/hibernate-orm","slug":"recursive-embeddable-mapping-detected-for-property","errorCode":null,"errorMessage":"Recursive embeddable mapping detected for property '<path>' of class '<className>'","messagePattern":"Recursive embeddable mapping detected for property '<path>' of class '<className>'","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/EmbeddableBinder.java","lineNumber":1056,"sourceCode":"\t\treturn embeddable;\n\t}\n\n\tprivate static boolean isIdentifierMapper(PropertyData inferredData, boolean isIdentifierMapper) {\n\t\treturn isIdentifierMapper && IDENTIFIER_MAPPER_PROPERTY.equals( inferredData.getPropertyName() );\n\t}\n\n\tprivate static void checkEmbeddableRecursiveHierarchy(\n\t\t\tTypeDetails type,\n\t\t\tPropertyData propertyData,\n\t\t\tPropertyHolder propertyHolder) {\n\t\tfinal var embeddableClass = type.determineRawClass();\n\t\twhile ( propertyHolder.isComponent() ) {\n\t\t\tfinal var componentHolder = (ComponentPropertyHolder) propertyHolder;\n\t\t\t// we need to check that the embeddable is not used in a recursive hierarchy\n\t\t\tvar classDetails = embeddableClass;\n\t\t\twhile ( classDetails != null ) {\n\t\t\t\tif ( propertyHolder.getClassName().equals( classDetails.getClassName() ) ) {\n\t\t\t\t\tthrow new MappingException( \"Recursive embeddable mapping detected for property '\"\n\t\t\t\t\t\t\t\t\t\t\t\t+ getPath( propertyHolder, propertyData )\n\t\t\t\t\t\t\t\t\t\t\t\t+ \"' of class '\" + propertyHolder.getClassName() + \"'\" );\n\t\t\t\t}\n\t\t\t\tclassDetails = classDetails.getSuperClass();\n\t\t\t}\n\t\t\tpropertyHolder = componentHolder.parent;\n\t\t}\n\t}\n\n\tprivate static void applyColumnNamingPattern(Component embeddable, PropertyData inferredData) {\n\t\tif ( embeddable.isDynamic() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( inferredData.getAttributeMember() == null ) {\n\t\t\t// generally indicates parts of a plural mapping (element, key, bag-id)\n\t\t\treturn;\n\t\t}","sourceCodeStart":1038,"sourceCodeEnd":1074,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/EmbeddableBinder.java#L1038-L1074","documentation":"Error \"Recursive embeddable mapping detected for property '<path>' of class '<className>'\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An @Embeddable / @Embedded / @ElementCollection mapping violates an embeddable mapping constraint.","commonSituations":"Embeddables with @Id members, inheritance, recursive composition, or properties split across multiple tables; or @Convert/@EmbeddedTable placed where unsupported.","solutions":["Break the recursive @Embedded cycle, e.g. by marking the back-reference @Transient or removing one side of the embedding."],"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"}