To-One Associations marked for LAZY fetch are fetched as a group with Hibernate

Solution Verified - Updated -

Issue

  • A class is defined with several to-one associations, each of which is marked with the following:
        @OneToOne(... fetch=FetchType.LAZY ...)
        @LazyToOne(value = LazyToOneOption.NO_PROXY)
        ...
  • Though a subset of the to-one associations may be required in some cases, individual queries are aggressively executed for each when the first to-one association 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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.