{"record":{"id":"e7fe6e7ac58a23a7","repo":"hibernate/hibernate-orm","slug":"attempt-to-use-multiple-inheritance-strategies","errorCode":null,"errorMessage":"Attempt to use multiple inheritance strategies : %s & %s","messagePattern":"Attempt to use multiple inheritance strategies : (.+?) & (.+?)","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/HbmXmlTransformer.java","lineNumber":1146,"sourceCode":"\t\t\tdefineInheritance( mappingEntity, InheritanceType.TABLE_PER_CLASS );\n\t\t}\n\n\t\tfor ( var hbmQuery : hbmClass.getQuery() ) {\n\t\t\t// Tests implied this was the case...\n\t\t\tfinal String name = hbmClass.getName() + \".\" + hbmQuery.getName();\n\t\t\tmappingXmlBinding.getRoot().getNamedQueries().add( transformNamedQuery( hbmQuery, name ) );\n\t\t}\n\n\t\tfor ( var hbmQuery : hbmClass.getSqlQuery() ) {\n\t\t\t// Tests implied this was the case...\n\t\t\tfinal String name = hbmClass.getName() + \".\" + hbmQuery.getName();\n\t\t\tmappingXmlBinding.getRoot().getNamedNativeQueries().add( transformNamedNativeQuery( hbmQuery, name ) );\n\t\t}\n\t}\n\n\tprivate void defineInheritance(JaxbEntityImpl mappingEntity, InheritanceType strategy) {\n\t\tif ( mappingEntity.getInheritance() != null && mappingEntity.getInheritance().getStrategy() != strategy ) {\n\t\t\tthrow new MappingException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\t\"Attempt to use multiple inheritance strategies : %s & %s\",\n\t\t\t\t\t\t\tmappingEntity.getInheritance().getStrategy(),\n\t\t\t\t\t\t\tstrategy\n\t\t\t\t\t),\n\t\t\t\t\torigin()\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\tmappingEntity.setInheritance( new JaxbInheritanceImpl() );\n\t\t\tmappingEntity.getInheritance().setStrategy( strategy );\n\t\t}\n\t}\n\n\tprivate void transferDiscriminatorSubclass(\n\t\t\tJaxbHbmDiscriminatorSubclassEntityType hbmSubclass,\n\t\t\tJaxbEntityImpl subclassEntity,","sourceCodeStart":1128,"sourceCodeEnd":1164,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/HbmXmlTransformer.java#L1128-L1164","documentation":"Error \"Attempt to use multiple inheritance strategies : %s & %s\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An entity hierarchy mixes different inheritance mapping strategies.","commonSituations":"Using different <subclass>/<joined-subclass>/<union-subclass> styles, or @Inheritance strategies, within a single hierarchy.","solutions":["Use exactly one inheritance strategy per entity hierarchy (SINGLE_TABLE, JOINED, or TABLE_PER_CLASS); remove the conflicting strategy annotations/elements.","Check the hbm.xml being transformed for mixed <joined-subclass> and <subclass>/<union-subclass> usage in one hierarchy.","Restructure the hierarchy if two strategies were genuinely needed."],"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"}