Embeddable properties in a subclass are ignored if they have the same name as superclass properties in Hibernate
Issue
-
An embeddable type has been defined.
@Embeddable public class Contact ... { ... private String name; ... } -
The embeddable is included in an entity which extends a superclass containing a property with the same name as an embeddable property.
@Entity @Inheritance(strategy = InheritanceType.JOINED) public abstract class Person ... { private String name; ... } @Entity public class Employee extends Person { ... @Embedded private Contact contact; ... } -
The DDL and SQL generated by Hiberante omit the property (e.g. "name") so it does not exist in the generated schema / cannot be persisted or read.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 7
- Hibernate 5
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
