Enhanced entity class resolves lazy field with OneToOne association when loaded

Description

If bytecode-enhancement is disabled, the lazy field with OneToOne association is not resolved. However if bytecode-enhancement is enabled, the lazy field is resolved(hibernate sends an additional sql statment to fetched the associated object).

The configuration of hibernate-enhance-maven-plugin is below

test case project with db ddl is attached. Please run JPAUnitTestCase to reproduce this issue.

Environment

JDK 1.8.0_131
postgresql 9.4.1212

Activity

Show:
Andrea
May 3, 2018, 10:31 AM
Edited

This issue still happens on 5.2.17 and it also affect fields annotated with @ManyToOne. We have updated from 4.3 to 5.2 version and we have now queries taking 10 minutes when previously was 20 sec.
As the documentation is quite poor regarding the enhancer, is worth using it on 5.2?

Assignee

Unassigned

Reporter

Jack Luo

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure