Fix for HHH-15759 broke our code

Description

Hello Hibernate Team,

My team and I have tried updating one of our main software projects from Hibernate 6.1.6 to 6.2.3 and we are unable to perform this upgrade due to an issue.

I have dug around enough, and have figured out the particular commit which is causing the issue.

The following code (hibernate-core/src/main/java/org/hibernate/mapping/Set.java:createPrimaryKey) needs to be looked at again and re-evaluated. I can provide a test-case in time, but as of right now, I do not have the test-case for you.

Here is a link to the particular commit which prevents us from upgrading to 6.2.3:

Old (working) code from 6.1.6 tag:


New (broken) code from 6.2.3 tag:

 

It looks like dreab8 (Andrea Boriero) was trying to solve this particular Jira ID:

 

Now I am not sure what the final fix should be, as reverting this commit may cause the original issue to break as well, however I am certain that current state the code is in is not the correct solution, as it causes major breakage in our (very) large project.

I would suggest playing around with a debugger to understand what is going on here.

Here’s my annotation:

 

Here is the original exception I got:

In our particular situation, we believe “idn” in this case should not be part of the referenced primary key (interlocking [idn,ctl_interlocking]). That is the mistake that is breaking the code.

Activity

Show:

Thomas Maurer April 11, 2024 at 10:10 AM

Hello Hibernate team
We had exactly the same problem when we migrated from Hibernate 5.6.7.Final to Hibernate 6.4.4.Final. I created a test case that reproduces the error. It occurs when @CollectionTable is used cascaded across multiple entities and when the first collection is a set and not a list. In our opinion, sets should still be usable.

Automation for Jira August 3, 2023 at 5:01 AM

This issue is being closed by automation because a test case was requested, but not provided.

Andrea Boriero May 30, 2023 at 3:41 PM

Hi ,

please provide a test case so I can investigate the issue and work an a solution.

Thanks

Incomplete

Details

Assignee

Reporter

Worked in

Affects versions

Priority

Created May 30, 2023 at 3:37 PM
Updated April 16, 2024 at 9:24 AM
Resolved August 3, 2023 at 5:01 AM