Bi-directional association management does not work with @EmbeddedId as the mapped by attribute in a @OneToMany

Description

Enhancing below classes produces EnhancementException:

Enhancer is trying to lookup the `bKey.a` field on the `B` class and can't find it, because it's not a field, but rather a field path expression:

https://github.com/hibernate/hibernate-orm/blob/b7b8f44298191db050f12819ca0594a30124df75/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/BiDirectionalAssociationHandler.java#L70

This is a blocker for using bytecode enhancement association management feature on a Maven/Gradle project with at least one entity using `@EmbeddedId` as there's no configuration point for excluding certain classes from enhancement in Maven/Gradle plugins.

Environment

None

Status

Assignee

Unassigned

Reporter

Dmitry Gusev

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure