StackOverflowError with @Fetch(FetchMode.SELECT) mapped for entity with an ID that is a bidirectional one-to-one eager association

Description

StackOverflowError is thrown when loading an entity with an ID that is an bidirectional eager one-to-one association has FetchMode.SELECT mapped, as in the following:

This happens when loading by ID using a query and when loading by primary key with EntityManager#find.

In addition, loading by ID using EntityManager#find fails with FetchMode.SELECT, whether lazy or eager due to HHH-14389.

Environment

None

Assignee

Unassigned

Reporter

Gail Badner

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