AnnotationException when @MapKey refers to a column mapped in @Embeddable: @ElementCollection (one to many embeddables)

Description

There's a problem mapping an @Embeddable as @ElementCollection (one to many) with an Enum as @MapKey (Hibernate 5.3.6.Final):

This fails with:

Here's another use case:

https://stackoverflow.com/questions/49940382/annotationexception-when-mapkey-refers-to-a-column-mapped-in-embeddable-map-val

Environment

Hibernate 5.3.6, MySQL 8.0, WildFly 14.0.1.Final

Status

Assignee

Gail Badner

Reporter

Ka Wu

Fix versions

None

backPortable

Backport?

Suitable for new contributors

Yes, likely

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.3.6
5.4.1

Priority

Major
Configure