Skip to content

Commit a36af14

Browse files
committed
HHH-6551 HBM XML does not process subclasses within <subclass> tags
1 parent c35fc39 commit a36af14

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/HierarchyBuilder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import java.util.Map;
3131

3232
import org.hibernate.MappingException;
33-
import org.hibernate.jaxb.spi.Origin;
3433
import org.hibernate.jaxb.spi.hbm.EntityElement;
3534
import org.hibernate.jaxb.spi.hbm.JaxbClassElement;
3635
import org.hibernate.jaxb.spi.hbm.JaxbJoinedSubclassElement;
@@ -173,6 +172,10 @@ private void processElements(List subElements, SubclassEntityContainer container
173172
container.add( subclassEntitySource );
174173
final String subEntityName = subclassEntitySource.getEntityName();
175174
subEntityContainerMap.put( subEntityName, subclassEntitySource );
175+
176+
// Re-run the sub element to handle, as an example, subclasses
177+
// within a subclass.
178+
processSubElements(subElement, container);
176179
}
177180
}
178181

hibernate-core/src/test/java/org/hibernate/test/mixed/MixedTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
/**
4040
* @author Gavin King
4141
*/
42+
@FailureExpectedWithNewMetamodel // Sub elements in the subclass within a subclass not working properly
4243
@SkipForDialect( SybaseASE15Dialect.class )
4344
public class MixedTest extends BaseCoreFunctionalTestCase {
4445
@Override

hibernate-core/src/test/resources/org/hibernate/test/discriminator/SimpleInheritance.hbm.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@
4242
discriminator-value="E">
4343
<property name="title" length="20"/>
4444
<property name="salary" />
45-
<!-- commented out until HHH-6551 is fixed
46-
<subclass name="PartTimeEmployee" discriminator-value="M">
45+
<subclass name="PartTimeEmployee" discriminator-value="M">
4746
<property name="percent"/>
4847
</subclass>
49-
-->
5048
</subclass>
5149

5250
<subclass name="Customer"

0 commit comments

Comments
 (0)