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:
Hibernate 5.3.6, MySQL 8.0, WildFly 14.0.1.Final
Still the same exception for Hibernate 5.4.1.Final:
, documentation for @MapKey says:
"The MapKey annotation is used to specify the map key for associations of type java.util.Map
when the map key is itself the primary key or a persistent field or property of the entity that is the value
of the map. "
PhoneNumber is an embeddable, not an entity. You should be using @MapKeyColumn instead.