@OneToOne + FetchType.LAZY fetches aggressively

Description

When an association is defined as below, lazy fetch is not enforced when querying the primary key side types - an HQL query such as "from Person" results in two separate SQL queries - one for the Person class and one for the Pet entity.

There should be a single query - for the Person HQL - and the Pet query should be executed only when the association getter is accessed.

Environment

None

Activity

Show:
Stephen Fikes
October 21, 2014, 7:02 PM

The attached test failed due to missing instrumentation required per http://docs.jboss.org/hibernate/orm/3.3/reference/en-US/html_single/#mapping-declaration-onetoone

Please close.

Assignee

Gail Badner

Reporter

Stephen Fikes

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure