Skip to content

Commit 0f86d12

Browse files
committed
HHH-19020 - provide more info in case a declared MappedSuperclass is not found
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 7d4af9b commit 0f86d12

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hibernate-core/src/main/java/org/hibernate/boot/model/internal/ClassPropertyHolder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import org.checkerframework.checker.nullness.qual.Nullable;
1414
import org.hibernate.AssertionFailure;
15+
import org.hibernate.HibernateException;
1516
import org.hibernate.MappingException;
1617
import org.hibernate.PropertyNotFoundException;
1718
import org.hibernate.boot.spi.MetadataBuildingContext;
@@ -274,6 +275,9 @@ public static void addPropertyToMappedSuperclass(
274275
ClassDetails declaringClass,
275276
MetadataBuildingContext context) {
276277
final MappedSuperclass superclass = context.getMetadataCollector().getMappedSuperclass( declaringClass.toJavaClass() );
278+
if ( superclass == null ) {
279+
throw new HibernateException( "Mapped superclass is null for declaring type " + declaringClass );
280+
}
277281
prepareActualProperty( prop, memberDetails, true, context, superclass::addDeclaredProperty );
278282
}
279283

0 commit comments

Comments
 (0)