Complex batch insert query stopped to work

Description

In my app I have the following entity model:

And other unrelated properties. Now, I perform the following batch insert query:

This works perfectly in Hibernate 5.4.21.Final and is translated to the following postgresql query:

But the same doesn't work in Hibernate 5.4.22.Final:

This is because these two lines are in wrong order:

And banks1_ (in the first line) is referred before it's introduced in the second line. This ends up in postresql with ERROR: missing FROM-clause entry for table "banks1_"

Activity

Christian BeikovOctober 30, 2020 at 8:55 AM

Fixed via

l0cofulOctober 30, 2020 at 8:45 AM

In 5.5.0.SNAPSHOT fetched just right now this bug is no longer present.

Christian BeikovOctober 29, 2020 at 9:47 AM

I just merged it, so you should be able to use the latest snapshot from https://repository.jboss.org/nexus/content/repositories/snapshots/org/hibernate/hibernate-core/5.5.0-SNAPSHOT/ to test this

l0cofulOctober 29, 2020 at 9:08 AM

Only when this fix will be available in some snapshot artifacts so that I could use it in a gradle build.

Christian BeikovOctober 28, 2020 at 5:45 PM

Could you try if solves your issue?

Fixed

Details

Assignee

Reporter

Worked in

Fix versions

Affects versions

Priority

Created October 26, 2020 at 2:29 PM
Updated November 17, 2020 at 9:20 PM
Resolved November 3, 2020 at 7:12 AM