Skip to content

Commit 3995164

Browse files
committed
Revert "HHH-18945 Reverted two changes from HHH-18693 - when meta model class is extending another class always use fully qualified class name"
This reverts commit a81c288.
1 parent e447325 commit 3995164

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tooling/metamodel-generator/src/main/java/org/hibernate/processor/ClassWriter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ else if ( modifiers.contains( Modifier.PROTECTED ) ) {
173173

174174
final Element superTypeElement = entity.getSuperTypeElement();
175175
if ( superTypeElement != null ) {
176-
pw.print( " extends " + getGeneratedSuperclassName( superTypeElement, entity.isJakartaDataStyle() ) );
176+
pw.print( " extends " +
177+
entity.importType(getGeneratedSuperclassName( superTypeElement, entity.isJakartaDataStyle() )) );
177178
}
178179
if ( entity.isImplementation() ) {
179180
pw.print( entity.getElement().getKind() == ElementKind.CLASS ? " extends " : " implements " );

tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/separatecompilationunits/SeparateCompilationUnitsTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ public void testInheritance() throws Exception {
2828
String entityMetaModel = getMetaModelSourceAsString( Entity.class );
2929
assertTrue(
3030
entityMetaModel.contains(
31-
"extends org.hibernate.processor.test.separatecompilationunits.superclass.MappedSuperclass"
31+
"import org.hibernate.processor.test.separatecompilationunits.superclass.MappedSuperclass_;"
32+
)
33+
);
34+
assertTrue(
35+
entityMetaModel.contains(
36+
"extends MappedSuperclass_"
3237
)
3338
);
3439
}

0 commit comments

Comments
 (0)