Setting @Any.fetch to FetchType.EAGER doesn't work

Description

Scenario:

There are multiple types of Employee: FullTimeEmployee, PartTimeEmployee, ...
Every Device has a owner with Employee type.

Reproduction steps:

1. Use @Any to map Device.owner and set fetch to FetchType.EAGER.
2. Retrieve a Device instance in a session.
3. Close the session.
4. Print out the owner of the device instance.

Expected result:

See the owner of the device instance.

Actual result:

org.hibernate.LazyInitializationException: could not initialize proxy [com.netbase.FullTimeEmployee#1] - no Session

Environment

None

Assignee

Vlad Mihalcea

Reporter

林自均

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure