How to Enable Spring Validation

独自空忆成欢 提交于 2019-12-06 16:25:44

You can disable Bean Validation by setting javax.persistence.validation.mode to none in your hibernate.cfg.xml (or persistence.xml when working with JPA).

Just out of interest, you seem to have constraint annotations on your model (otherwise you shouldn't see a ConstrainViolationException, so I'm wondering why you don't want to validate them?

Adding hibernate validator to the classpath turns off hibernate core validation, so I had to add this property to turn it back on

<prop key="hibernate.check_nullability">true</prop>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!