Non-optional OneToOne relation can't be lazy loaded anymore

Description

I don't think it is an intended side effect, but with the fix for HHH-9460, which always sets the foreign key type to ForeignKeyDirection.TO_PARENT if the type references the primary key,
OneToOneType.isNullable() will return true, which then causes LoadEventListener.INTERNAL_LOAD_NULLABLE to be used rather than LoadEventListener.INTERNAL_LOAD_LAZY. This effectively prevents lazy loading to be used with non-optional/constrained OneToOne relations.

Testcase: https://github.com/hibernate/hibernate-orm/pull/2474

Environment

None

Status

Assignee

Jan-Willem Gmelig Meyling

Reporter

Jan-Willem Gmelig Meyling

Fix versions

Labels

None

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.2.14
5.2.17
5.3.1
5.2.15
5.3.2
5.2.16

Priority

Major
Configure