[hibernate-dev] Is the the optional=false @OneToOne lazy retrieval still relevant

Steve Ebersole steve at hibernate.org
Fri Jan 8 10:45:43 EST 2016

Depending on exactly how you are testing that, that sounds like a bug.  Are
you (inadvertently) using bytecode enhancement?

On Fri, Jan 8, 2016 at 9:09 AM Vlad Mihalcea <mihalcea.vlad at gmail.com>

> Hi,
> I remember that for a bidirectional @OneToOne relationship, the optional =
> false attribute could instruct Hibernate to always generate a Proxy
> (because this association cannot be null),
> so, if the fetch is LAZY, it would not generate a secondary query upon
> fetching the parent-side entity.
> I tested it with the latest Hibernate, and when fetching the parent entity
> it always generates the secondary select for the child entity too.
> Is this optimization not relevant anymore or is it an issue?
> Vlad
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

More information about the hibernate-dev mailing list