Inconsistent JOIN FETCH for standard entities and enhanced entities

Description

JOIN FETCH for standard (non bytecode enhanced entities) fetches initialized entities.
The domain graph can be fully accessed outside a session.

JOIN FETCH for bytecode enhanced entities fetches not initialized entities and throws LazyInitializationException.
The domain graph accessed outside a session throws LazyInitializationException.

I attached a test

. JPAHibernateJoinTest.
Errors out with byte code enhacement enabled (default - uncommented build section in main pom.xml).
Works fine without (comment build section in main pom.xml).

Environment

Windows 10, Java 8, Hibernate 5.2.13, Oracle (H2 for the test)

Status

Assignee

Unassigned

Reporter

Josef Maxa

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

4.2.8

Components

Affects versions

5.2.13

Priority

Major
Configure