samedi 24 février 2018

get javax.validation instead of org.hibernate.exception ConstraintViolationException

While using Spring Boot I get DataIntegrityViolationException whichs getCause() method returns org.hibernate.exception.ConstraintViolationException. I want to make it returns javax.validation.ConstraintViolationException instead, this one has methods more specified for extracting constraint violations. How can I do that?

I have these dependencies on my classpath and my application.properties file is empty right now.

spring-boot-starter-jpa-1-5-10 hibernate.validator-5-3-6 hibernate-entitymanager-5-0-12 hibernate-core-5-0-12

Aucun commentaire:

Enregistrer un commentaire