Search code examples
javahibernatecompatibilityhibernate-validatorhibernate3

Hibernate Validator 5 version compatibility with Hibernate 3.5


Is it safe to use the Hibernate Validator 5.0.1 with Hibernate 3.5.4? From what I've read it should not be a problem and I'm not running into any errors so far (i.e. application compiles, runs and tests pass), but I'm not sure if they fit well together.

Related Hibernate & JPA libs (inside /WEB-INF/libs):

hibernate3.jar
hibernate-annotations-3.5.4-Final.jar
hibernate-commons-annotations-3.2.0.Final.jar
hibernate-core-3.5.4-Final.jar
hibernate-entitymanager-3.5.4-Final.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
hibernate-validator-5.0.1.Final.jar
hibernate-validator-annotation-processor-5.0.1.Final.jar
validation-api-1.1.0.Final.jar

FYI:

Tomcat 7.0.39
Spring 3.0.3
PostgreSQL 9.2
Flyway 2.1.1
BoneCP 0.7.1

Solution

  • You should be fine with using Bean Validation 1.1/Hibernate Validator 5.0.1; Hibernate ORM depends on the Bean Validation API only, and BV 1.1 is compatible with BV 1.0.

    I recommend to check the Hibernate Validator migration guide to see whether any of the issues listed there might affect you (for instances changes around logging and the usage of Java 6).