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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content