Hypersistence Optimizer allows you to get the most out of JPA and Hibernate. By scanning your application configuration and mappings, Hypersistence Optimizer can tell you what changes you need to do to speed up your data access layer.
When fetching a parent entity that has a bidirectional @OneToOne association, Hibernate can trigger a secondary query for the child entity even if the association is using the FetchType.LAZY strategy.
Newer versions of Hibernate can avoid this issue if the parent association is set to optional=false. However, for optional=true and for older Hibernate versions, the secondary query is triggered, and we should also trigger a SecondaryQueryEntityFetchingEvent.
When fetching a parent entity that has a bidirectional
@OneToOne
association, Hibernate can trigger a secondary query for the child entity even if the association is using theFetchType.LAZY
strategy.Newer versions of Hibernate can avoid this issue if the parent association is set to
optional=false
. However, foroptional=true
and for older Hibernate versions, the secondary query is triggered, and we should also trigger aSecondaryQueryEntityFetchingEvent
.