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

Activity

Show:
Gail Badner
September 17, 2018, 7:10 PM

, , sorry for the delay on fixing this, but I believe that the fix will cause regressions for applications that use @NotFound( IGNORE ). I'm actively in process of sorting those out. Once those are fixed, this issue will be fixed.

Jan-Willem Gmelig Meyling
September 18, 2018, 11:45 AM

Hi Gail, thanks for picking this up again. If there's any way I can help, please let me know. I'd really like to see this issue resolved the sooner the better

Thanks again!

Gail Badner
October 27, 2018, 1:45 AM
Edited

, I created a new PR for HHH-12436. It should fix this issue. Please give it a try and let me know if it does. Thanks!

Jan-Willem Gmelig Meyling
October 27, 2018, 8:51 AM

Hi Gail! Thanks for looking into HHH-12436. It does not yet resolve this issue. I've left a comment on your PR why I am sure this is the case. I've rebased my branch upon yours so that we can hopefully combine the two.

Gail Badner
October 31, 2018, 7:17 PM

Fixed in master. , thanks for your work on this!

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

Priority

Major
Configure