Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZDA5MzFlNWE4...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16396?atlOrigin=eyJpIjoiZDA5Mz...
) HHH-16396 (
https://hibernate.atlassian.net/browse/HHH-16396?atlOrigin=eyJpIjoiZDA5Mz...
) HQL with SubQuery having same alias of root query generates wrong SQL (
https://hibernate.atlassian.net/browse/HHH-16396?atlOrigin=eyJpIjoiZDA5Mz...
)
Issue Type: Bug Affects Versions: 6.2.0.CR4 Assignee: Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Created: 29/Mar/2023 07:27 AM Environment: the following HQL query
```
select
e.otherEntity.id,
(select e.aString from MyEntity e where e.otherEntity.id = :anotherEntityId)
from
MyEntity e
```
uses the wrong alias for `e.manyToOne`, `m1_0.otherEntity_id` instead of
`m1_0.otherEntity_id`
```
select
m1_0.otherEntity_id,
(select
m2_0.aString
from
MyEntity m2_0
where
m1_0.otherEntity_id=?)
from
MyEntity m1_0
where
m1_0.id=?
``` Fix Versions: 6.2.0 Priority: Major Reporter: Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
(
https://hibernate.atlassian.net/browse/HHH-16396#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16396#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100219- sha1:6a6077b )