Add support for multiple generic embeddable properties in MappedSuperclass

Description

At the moment an @Entity can extend a @MappedSuperclass which has two or more generic embeddable properties. This will work, but when trying to query the actual properties inside the concrete embeddable types (as opposed to the generic ones) an error will be thrown because we have no way of retrieving them.

HHH-16195: Hibernate 6 fails to bind appropriate type for mapped superclass with generic attributeClosed fixes embeddable-typed declaredProperties registration for generic embeddables on the superclass, and HHH-16188: Exception when find by field of generic @EmbeddedId with @MappedSuperclassClosed has prepared a foundation to register the actual concrete embeddable types that for now is only used for identifiers:

  • org.hibernate.metamodel.model.domain.AbstractManagedType.InFlightAccessImpl#addConcreteEmbeddableAttribute

  • org.hibernate.metamodel.model.domain.AbstractManagedType#findConcreteEmbeddableAttribute

This issue should address resolving concrete embeddable types for non-identifier properties.

Activity

Show:

Debbie Philip August 1, 2023 at 8:24 AM

This breaks if the embeddable is generic and extends an attribute from its superclass. I’ve attached the test case to reproduce this on

https://hibernate.atlassian.net/browse/HHH-16755

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created February 28, 2023 at 11:41 AM
Updated August 1, 2023 at 8:24 AM
Resolved March 3, 2023 at 3:01 PM