When using the validation mode CALLBACK (triggers an error if no BV provider is found), constraints are not considered in the emitted DDL. Instead, the option for controlling lifecycle validation (validation mode), shouldn't affect whether constraints are part of generated DDL or not. There already is a dedicated option for this, {{hibernate.validator.apply_to_ddl}}, but the two options aren't handled completely independently in the current implementation.
As [discussed on hibernate-dev|http://lists.jboss.org/pipermail/hibernate-dev/2018-February/017176.html], we should:
* drop DDL as an allowable validation mode (as that setting is about lifecycle validation, not DDL control) * no longer allow multiple values for validation mode ( as that's not needed when not piggy-backing on this setting for DDL control, also the dedicated {{<validation-mode>}} element in the XSD allows only one value anways ) * control constraint export in DDL exclusively via {{hibernate.validator.apply_to_ddl}}; as we only can deprecate but not remove {{ValidationMode.DDL}} in 5.3, this still would work (raising a warning), but the property would take precedence in case of contradictory settings |
|