I don't think it is an intended side effect, but with the fix for HHH-9460, [which always sets the foreign key|https://github.com/hibernate/hibernate-orm/pull/2128/files#diff-6af8d09ecfe77b1855d03b0ebc37fc28R98] type to ForeignKeyDirection.TO_PARENT if the type references the primary key, [ OneToOneType.isNullable()|https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/type/OneToOneType.java#L157-L160] will return true, which then causes [LoadEventListener.INTERNAL_LOAD_NULLABLE|https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java#L1131-L1136] to be used rather than LoadEventListener.INTERNAL_LOAD_LAZY. This effectively prevents lazy loading to be used with non-optional/constrained OneToOne relations. |
|