Hibernate metamodel initialization fails on nested Embeddable that implements MappedSuperclass

Description

The issue is highly likely related to the

Hibernate metamodel initialization fails when there is no implementation found for a MappedSupperclass i.e. getSubTypes() is empty in the line below though there is an Embeddable implementing the MappedSuperclass.

Stacktrace:

To reproduce create a nested embeddable like:

Here, both AuditBase and VersionBase are considered as unusedMappedSuperclass when building metamodel context. The context will be processed successfully in case when AuditBase processed first and VersionBase processed after. And it will fail when the VersionBase processed before AuditBase likely due to the fact that VersionInfo implementation of VersionBase gets known only after processing AuditBase which uses it as its property type. Unfortunately unused @MappedSuperclass are not ordered in the metadata context and thus build success depends on a random order.
Possible solution is to order unused mappedsuperclass entries somehow to get AuditBase always processed before VersionBase from the example above.

Activity

Show:

Marco Belladelli November 13, 2024 at 9:05 AM

Might be somewhat related to , though I suspect the cause here is slightly different.

Details

Assignee

Reporter

Worked in

Sprint

Affects versions

Priority

Created October 31, 2024 at 12:59 PM
Updated February 25, 2025 at 1:32 PM