Subselect fetching doesn't work when multiLoad was used

Description

Given some entities loaded into the session via MultiIdentifierLoadAccess.multiLoad() in one batch via a query using an in-clause. These entities have lazy-fetched OneToMany associations annotated with FetchMode.SUBSELECT.
When accessing these associations, they will be fetched using one query per parent entity, just as if the parent entities had been loaded one by one.

This creates serious performance issues when using multiLoad as a replacement for directly querying multiple IDs, which we did do utilize 1st level cache.

Environment

None

Status

Assignee

Gail Badner

Reporter

Christian Michaelis

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure