Hibernate @Embeddable class which extends another @Embeddable class, Properties not found for @OneToMany mapping

You can implement inheritance between @Embeddable classes. You just have to annotate the parent class with @MappedSuperclass too. So, e.g.: @Embeddable @MappedSuperclass public class Parent { @Basic private String parentProperty; // … getters/setters } @Embeddable public class Child extends Parent { @Basic private String childProperty; // … getters/setters } This way Hibernate (tested with 5.x) … Read more

Can I make an embedded Hibernate entity non-nullable?

Embeddable components (or composite elements, whatever you want to call them) usually contain more than one property and thus are mapped to more than one column. The entire component being null can therefore be treated in different ways; J2EE spec does not dictate one way or another. Hibernate considers component to be NULL if all … Read more