Search This Blog

Wednesday, November 14, 2018

How to fix: Bean Validation constraint(s) violated while executing Automatic Bean Validation on callback event:'prePersist'

If you are using JPA and get the exception:

Bean Validation constraint(s) violated while executing Automatic Bean Validation on callback event:'prePersist'

But you are not clear what exactly goes wrong. You can fix it by adding the code to show you more detail about the validation exception: