{"record":{"id":"a3ef2d92521337b5","repo":"hibernate/hibernate-orm","slug":"embeddable-did-not-define-class-nor-name","errorCode":null,"errorMessage":"Embeddable did not define class nor name","messagePattern":"Embeddable did not define class nor name","errorType":"exception","errorClass":"ModelsException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/models/xml/internal/ManagedTypeProcessor.java","lineNumber":690,"sourceCode":"\n\t\tXmlAnnotationHelper.applyLifecycleCallbacks( jaxbClass, classDetails, xmlDocumentContext );\n\t}\n\n\tpublic static void processCompleteEmbeddable(\n\t\t\tJaxbEntityMappingsImpl jaxbRoot,\n\t\t\tJaxbEmbeddableImpl jaxbEmbeddable,\n\t\t\tXmlDocumentContext xmlDocumentContext) {\n\t\tfinal MutableClassDetails classDetails;\n\t\tfinal AccessType classAccessType;\n\t\tfinal AttributeProcessor.MemberAdjuster memberAdjuster;\n\n\t\tfinal var classDetailsRegistry =\n\t\t\t\txmlDocumentContext.getModelBuildingContext()\n\t\t\t\t\t\t.getClassDetailsRegistry();\n\n\t\tif ( isEmpty( jaxbEmbeddable.getClazz() ) ) {\n\t\t\tif ( isEmpty( jaxbEmbeddable.getName() ) ) {\n\t\t\t\tthrow new ModelsException( \"Embeddable did not define class nor name\" );\n\t\t\t}\n\t\t\t// no class == dynamic...\n\t\t\tclassDetails = (MutableClassDetails) ModelsHelper.resolveClassDetails(\n\t\t\t\t\tjaxbEmbeddable.getName(),\n\t\t\t\t\txmlDocumentContext,\n\t\t\t\t\tclassDetailsRegistry,\n\t\t\t\t\t() -> new DynamicClassDetails( jaxbEmbeddable.getName(),\n\t\t\t\t\t\t\txmlDocumentContext.getModelBuildingContext() )\n\t\t\t);\n\t\t\tclassAccessType = AccessType.FIELD;\n\t\t\tmemberAdjuster = ManagedTypeProcessor::adjustDynamicTypeMember;\n\n\t\t\tprepareDynamicClass( classDetails, jaxbEmbeddable, xmlDocumentContext );\n\t\t}\n\t\telse {\n\t\t\tfinal String className = XmlProcessingHelper.determineClassName( jaxbRoot, jaxbEmbeddable );\n\t\t\tclassDetails = (MutableClassDetails) classDetailsRegistry.resolveClassDetails( className );\n\t\t\tclassAccessType = coalesce(","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/models/xml/internal/ManagedTypeProcessor.java#L672-L708","documentation":"Error \"Embeddable did not define class nor name\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An hbm.xml / orm.xml mapping document violates a mapping rule during bootstrap.","commonSituations":"Legacy XML mappings with invalid combinations (column+formula, mixed inheritance, missing identifiers, bad extends references).","solutions":["Set either the class or name attribute on the <embeddable/> element in the XML mapping."],"exampleFix":"Set either the class or name attribute on the <embeddable/> element in the XML mapping.","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"}