RenderingContext::aliasCount is not preserved between createQuery() calls, leading to incorrect query if CriteriaQuery is changed

Description

As far as I know it's not prohibited to change CriteriaQuery between createQuery() calls. Internally Hibernate assigns aliases to used roots on first createQuery() call. Those aliases can conflict with aliases from new subquery conditions added after before second createQuery() call, leading to incorrect query generated.

 

Attachments

1

Activity

Show:

Christian Beikov December 22, 2023 at 7:22 PM

This is not a problem in Hibernate ORM 6 anymore.

Out of Date

Details

Assignee

Reporter

Components

Affects versions

Priority

Created September 8, 2021 at 2:34 PM
Updated December 22, 2023 at 7:22 PM
Resolved December 22, 2023 at 7:22 PM