{"record":{"id":"c33e70a77caa6415","repo":"hibernate/hibernate-orm","slug":"embeddable-class-componentclassname-has-proper","errorCode":null,"errorMessage":"Embeddable class '<componentClassName>' has properties mapped to two different tables (all properties of the embeddable class must map to the same table)","messagePattern":"Embeddable class '<componentClassName>' has properties mapped to two different tables \\(all properties of the embeddable class must map to the same table\\)","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/ComponentPropertyHolder.java","lineNumber":307,"sourceCode":"\t\t\tMemberDetails attributeMemberDetails,\n\t\t\t@Nullable AnnotatedColumns columns,\n\t\t\tClassDetails declaringClass) {\n\t\t//AnnotatedColumns.checkPropertyConsistency( ); //already called earlier\n\t\t// Check table matches between the component and the columns\n\t\t// if not, change the component table if no properties are set\n\t\t// if a property is set already the core cannot support that\n\t\tassert columns == null || property.getValue().getTable() == columns.getTable();\n\t\tsetTable( property.getValue().getTable() );\n\t\taddProperty( property, attributeMemberDetails, declaringClass );\n\t}\n\n\tprivate void setTable(Table table) {\n\t\tif ( !table.equals( getTable() ) ) {\n\t\t\tif ( component.getPropertySpan() == 0 ) {\n\t\t\t\tcomponent.setTable( table );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new AnnotationException(\n\t\t\t\t\t\t\"Embeddable class '\" + component.getComponentClassName()\n\t\t\t\t\t\t+ \"' has properties mapped to two different tables\"\n\t\t\t\t\t\t+ \" (all properties of the embeddable class must map to the same table)\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( parent instanceof ComponentPropertyHolder parentComponentHolder ) {\n\t\t\t\tparentComponentHolder.setTable( table );\n\t\t\t}\n\t\t}\n\t}\n\n\t@Override\n\tpublic Join addJoin(JoinTable joinTable, boolean noDelayInPkColumnCreation) {\n\t\treturn parent.addJoin( joinTable, noDelayInPkColumnCreation );\n\t}\n\n\t@Override\n\tpublic Join addJoin(JoinTable joinTable, Table table, boolean noDelayInPkColumnCreation) {","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ComponentPropertyHolder.java#L289-L325","documentation":"Error \"Embeddable class '<componentClassName>' has properties mapped to two different tables (all properties of the embeddable class must map to the same table)\" 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":["Map all properties of the embeddable class to the same table (fix @Column(table=...) overrides)."],"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"}