{"record":{"id":"4e3f400e79f2c39d","repo":"hibernate/hibernate-orm","slug":"mapped-composite-identifier-must-name-component-cl","errorCode":null,"errorMessage":"mapped composite identifier must name component class to use.","messagePattern":"mapped composite identifier must name component class to use\\.","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/EntityHierarchySourceImpl.java","lineNumber":106,"sourceCode":"\t\t\t\t\tString.format(\n\t\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\t\"Entity [%s] did not define an identifier\",\n\t\t\t\t\t\t\trootEntitySource.getEntityNamingSource().getEntityName()\n\t\t\t\t\t),\n\t\t\t\t\trootEntitySource.origin()\n\t\t\t);\n\t\t}\n\n\t\tif ( simpleId != null ) {\n\t\t\treturn new IdentifierSourceSimpleImpl( rootEntitySource );\n\t\t}\n\t\telse {\n\t\t\t// if we get here, we should have a composite identifier.  Just need\n\t\t\t// to determine if it is aggregated, or non-aggregated...\n\n\t\t\tif ( compositeId.isMapped() ) {\n\t\t\t\tif ( StringHelper.isEmpty( compositeId.getClazz() ) ) {\n\t\t\t\t\tthrow new MappingException(\n\t\t\t\t\t\t\t\"mapped composite identifier must name component class to use.\",\n\t\t\t\t\t\t\trootEntitySource.origin()\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( StringHelper.isEmpty( compositeId.getName() ) ) {\n\t\t\t\tif ( compositeId.isMapped() && StringHelper.isEmpty( compositeId.getClazz() ) ) {\n\t\t\t\t\tthrow new MappingException(\n\t\t\t\t\t\t\t\"mapped composite identifier must name component class to use.\",\n\t\t\t\t\t\t\trootEntitySource.origin()\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn new IdentifierSourceNonAggregatedCompositeImpl( rootEntitySource );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ( compositeId.isMapped() ) {\n\t\t\t\t\tthrow new MappingException(","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/EntityHierarchySourceImpl.java#L88-L124","documentation":"Error \"mapped composite identifier must name component class to use.\" 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 the class attribute on <composite-id/> naming the embeddable/component class to use."],"exampleFix":"Set the class attribute on <composite-id/> naming the embeddable/component class to use.","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"}