We're updating the issue view to help you get more done. 

Allow Criteria queries to use ScrollableResults with fetching like HQL

Description

When retrieving an object that contains an eagerly loaded collection (one to many), Query returns the expected ScrollableResults but Criteria returns only the first element of the (and duplicates as other elements).

e.g.
Parent A with children [1,2,3]

Query:
-Returns 1 object with children [1,2,3]

Criteria:
-Return 3 object with children [1]

Debug information:
This issue is affected by the 'list()' function. Calling criteria.list() before criteria.scroll() will affect the objects returned.

Providing a failing test case running with h2.

Environment

None

Status

Assignee

Unassigned

Reporter

Christian Gendreau

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.0.8
5.1.0
4.3.7

Priority

Major