Impossible to give same path expression multiple aliases

Description

Simple example:

select a.id as id1, a.id as id2 from Entity a

This doesn’t work anymore as of Hibernate 6 because the selection alias is kept on the SQM node directly, leading to the following exception:

Not sure yet how to solve this, but this is blocking Blaze-Persistence from being usable with Hibernate 6. Maybe this is as simple as keeping the alias in a field in SqmSelectionand just relying on the alias in the AbstractTupleElementto mutate throughout the query parsing process.

Also test if ordering by id1 or id2 will cause issues due to selection item deduplication.

Activity

Show:
Fixed

Details

Assignee

Reporter

Worked in

Components

Fix versions

Affects versions

Priority

Created June 15, 2022 at 12:59 AM
Updated July 1, 2022 at 12:08 PM
Resolved June 15, 2022 at 8:58 AM