Hibernate 6 fails to bind appropriate type for mapped superclass with generic attribute

Description

If a base class (mapped superclass) has a generic attribute and there are more than one subclasses (entities) with different (concrete) attribute types, hibernate 6 will incorrectly use the first (alphabetically) attribute type as required for all entities. This in turn causes an exception when trying to query using the generic attribute.

Minimal test case: https://github.com/kuba-wu/h6-demo

This used to work in Hibernate < 6.
Issue confirmed with latest stable (6.1.7) and devel (6.2.0.CR2).

Activity

Show:
Fixed

Details

Assignee

Reporter

Worked in

Components

Fix versions

Affects versions

Priority

Created February 17, 2023 at 3:04 PM
Updated March 1, 2023 at 8:33 PM
Resolved March 1, 2023 at 12:26 PM