I'm not sure when this bug was introduced, maybe HHH-8113 was the wrong fix. I might have not seen this for a few weeks.
The JPASchemaGenerator ignores @NotNull constraints. The attached screenshots show the call stacks for the Column#setNullable() method during bootstrap with schema generation enabled.
The first call stack shows that JPASchemaGenerator only uses AnnotationBinder and Ejb3Column to determine whether the column is nullable.
The second call stack is buildSessionFactory() running right after performGeneration(), here the BeanValidationIntegrator is called.
|