BatchFetching does not work with BytecodeEnhancement

Description

Batch Fetching stops working when I enable bytecode enhancement.

I'm using hibernate-enhance-maven-plugin for build time enhancement.

I used reflection at the Test case, is there a better way to validate this issue?

persistence.xml

Bytecode Enabled, n 1 problem loading members

Hibernate:
/*
from
Team */ select
team0_.id as id1_1_
from
Team team0_
Hibernate:
/* load one-to-many com.test.entities.Team.members */ select
members0_.team_id as team_id3_0_1_,
members0_.id as id1_0_1_,
members0_.id as id1_0_0_,
members0_.name as name2_0_0_,
members0_.team_id as team_id3_0_0_
from
Member members0_
where
members0_.team_id=?

(repeats for each team)

Bytecode Disabled, Batch Fetching working properly

Hibernate:
/*
from
Team */ select
team0_.id as id1_1_
from
Team team0_
Hibernate:
/* load one-to-many com.test.entities.Team.members */ select
members0_.team_id as team_id3_0_1_,
members0_.id as id1_0_1_,
members0_.id as id1_0_0_,
members0_.name as name2_0_0_,
members0_.team_id as team_id3_0_0_
from
Member members0_
where
members0_.team_id in (
?,?,?,?,?,?,?,?,?,?
)

Environment

None

Assignee

Unassigned

Reporter

Rodrigo Lourenço

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