@Basic(optional) not overridden when using an @Embeddable type in Hibernate
Issue
-
An entity using an embeddable attempts to override the
@Basic(optional = false)setting@Embeddable public class MyEmbeddable ... { @Basic(optional = false) @Column(nullable = false) private String someProperty; ... } @Entity public class MyEntity ... { @Embedded @AttributeOverrides({ @AttributeOverride(name = "someProperty", column = @Column(nullable = true))) }) private MyEmbeddable embeddedType; ... } - The generated DDL marks the database column as non-null allowed
- No warnings are logged and no exceptions are raised during configuration
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6
- Hibernate 4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.