When generating a DB schema via Persistence#generateSchema(), Bean Validation constraints are not considered when creating the create DDL statements. BeanValidationIntegrator#integrate() is never called in that case, hence TypeSafeActivator isn't invoked either, which would amend the DDL based on constraints such as @NotNull, @Size etc.
If I bootstrap an EMF and e.g. trigger schema generation via javax.persistence.schema-generation.scripts.action the constraints show up in the emitted DDL as expected.
stumbled on this issue too, 5.1.10 also affected
trying to migrate to Wildfly 11.0.0.Final (Hibernate 5.1.10,Final) from 10.0.1.Final(hibernate 5.0.10.Final)
have entity with some not null columns:
this is dml generated by 5.1.10.Final:
only id field has notnull-modifier
this is dml generated by 5.0.10.Final:
all @NotNull-fields have notnull-modifier
I also experience this issue when switching from Hibernate 5.0 to 5.1
I also added javax.el dependency for validator, but this doesn't fix it.
Same regression here, except I am calling org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl#generateSchema. Pretty surprised there isn't any progress on this major issue.