I am upgrading an application to Spring Boot 3 and Hibernate 6.
From:
Spring Boot: 2.7.12
Hibernate: 5.6.15.Final
QueryDSL: 5.0.0
To:
Spring Boot: 3.0.6
Hibernate: 6.1.7.Final
QueryDSL: 5.0.0
When doing queries, I am using projections directly for DTO-less application.
return queryFactory.selectFrom(entity).transform(
groupBy(entity.id)
.as(
(Projections.bean(
Details.class,
entity.id,
Projections.fields(
Header.class,
entity.customer.as("customer")
.as("header"),
Projections.bean(
DetailsCustomer.class,
entity.customer3lc.as("customer")
.as("customer");
As you can see, I am using the same alias “customer” twice, which with the new version SQM throws an error:
Alias [customer] is already used in same select clause [position=7]
This may be related to the new SQM tree, and maybe the change from alias to position.
Do you know any workaround or is this the intended behaviour?
Sorry if this is a QueryDSL thing, and not Hibernate.