Attaching the same test in Hibernate 5.6.15 where the same HQL generates the following SQL, which is correct (returning both ids):
SchedulingSubpart (c5923ae2-1380-4fb9-8a78-a2d7e9aa5314).java![](cid:jira-generated-image-static-link_attachment_7-9ef8d9a2-a87a-4375-b418-23c859d0d4b4) ORMStandaloneTestCase (b4b995f1-5049-4142-98bd-7859da696d92).java![](cid:jira-generated-image-static-link_attachment_7-9ef8d9a2-a87a-4375-b418-23c859d0d4b4) |