Malformed query generated when using @DiscriminatorValue

Description

Repo to reproduced the issue https://github.com/gaetannandelec-ibboost/hibernate6-discriminatorbug
Post about this issue https://discourse.hibernate.org/t/hibernate-6-wrong-query-generated-with-discriminatorvalue/6984

When the sql query is generated and we have a join on an entity using DiscriminatorValue, the dicriminatorcolumn criteria is added to the where clause rather than the join itself


Activity

Show:

Marco Belladelli February 9, 2024 at 8:06 AM

Hi , I’ve replied on your SO post. Your problem sounds very similar to https://hibernate.atlassian.net/browse/HHH-16438, which was resolved in 6.2. We suggest upgrading to the latest Hibernate version to take advantage of all improvements and bugfixes, and if you find any problems please reporte them in a new issue.

Petula Lau February 8, 2024 at 8:19 PM

Hi I know this issue is closed, but I am having a maybe similar problem with the query in the where clause - if anyone can please help answer I would much appreciate it. Thank you.

https://stackoverflow.com/questions/77964533/updating-from-hibernate-5-5-x-to-hibernate-6-1-7-generated-the-incorrect-discrim

Vincent Bouthinon February 20, 2023 at 3:41 PM

For information, it also fixes my problem. Thank you.

Marco Belladelli February 9, 2023 at 2:18 PM

Looks like this issue was solved by https://hibernate.atlassian.net/browse/HHH-15902 . I tested your reproducer and I can confirm that this is fixed in Hibernate 6.1.7.Final.

Vincent Bouthinon January 25, 2023 at 1:34 PM

Fixed

Details

Assignee

Reporter

Worked in

Fix versions

Affects versions

Priority

Created December 6, 2022 at 5:02 PM
Updated February 9, 2024 at 8:06 AM
Resolved February 9, 2023 at 2:19 PM

Flag notifications