To-One Associations marked for LAZY fetch are fetched as a group with Hibernate
Issue
- A class is defined with several
to-oneassociations, each of which is marked with the following:
@OneToOne(... fetch=FetchType.LAZY ...)
@LazyToOne(value = LazyToOneOption.NO_PROXY)
...
- Though a subset of the
to-oneassociations may be required in some cases, individual queries are aggressively executed for each when the firstto-oneassociation is accessed.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 5
- 6
- Hibernate
- 3
- 4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.