Support constructor expression mixed with other select expressions

Description

In Hibernate if a constructor expression is used, it must be the only select expression in the query.
So select new a.b.Foo(p.name, p.city) from Person p is supported, but these are not:

  • select p.id, new a.b.Foo(p.name, p.city) from Person p

  • select new a.b.Foo(p.name, p.city), new a.b.Bar(p.age) from Person p

  • etc

However, these should be supported according to the official JPQL syntax:
{{
select_clause ::= SELECT [DISTINCT] select_expression {, select_expression}*
select_expression ::= single_valued_path_expression | aggregate_expression | identification_variable | OBJECT(identification_variable) | constructor_expression
constructor_expression ::= NEW constructor_name ( constructor_item {, constructor_item}* )
}}
See also https://hibernate.atlassian.net/browse/HHH-3082.

I am working on a Pull Request to support this.

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Marcus Klimstra

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Major