Stackoverflow when applying a restriction to the selection of a suquery

Description

I've got a (Criteria) sub-query which is generated somewhere else and where I want to add another restriction on the selection:

If I execute the associated query, I run into a StackOverflowException:

The problem is that the wrapper, which is returned by CriteriaSubqueryImpl.getSelection(), is not rendering the single expression, but the whole subquery instead.

This was introduced with HHH-7451, but I can't see where the JPA 2.1 spec explicitly requires this behavior. Maybe this is an obsolete leftover from the draft version?

Environment

None

Activity

Show:
Gail Badner
December 20, 2016, 9:15 PM

, please attach a test case that reproduces this issue. You can find a test template at: https://github.com/hibernate/hibernate-test-case-templates/ .

Tobias Liefke
January 8, 2017, 9:28 PM
Edited

You can find the test case attached.

Gail Badner
January 9, 2017, 10:30 PM

Test case worked properly using 4.2.21.Final.

Assignee

Unassigned

Reporter

Tobias Liefke

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure