Search code examples
javahibernate-validator

Hibernate Validator implementation


I am considering using Hibernate Validator for my project.

http://www.hibernate.org/subprojects/validator.html

I have a few questions and hopefully experiences software engineer can share their knowledge.

1) Is there any better alternative to Hibernate Validator? We are using HIBERNATE ORM and hope to integrate it into our solution

2) Any significant implementation issue to highlight?

3) Does it work on POJOs or Java Beans only?


Solution

  • 1) Is there any better alternative to Hibernate Validator? We are using HIBERNATE ORM and hope to integrate it into our solution

    Hibernate Validator is the reference implementation of the Bean Validation specification (JSR 303 and 349). See also http://beanvalidation.org/. So as long as you stick to the specified functionality you are free to switch to any Bean Validation implementation you like.

    Even though Hibernate Validator and Hibernate ORM live under the same umbrella (Hibernate), they are independent projects and one does not require the other.

    2) Any significant implementation issue to highlight?

    Not really. As in any other software there are bugs which you can track or report here - https://hibernate.atlassian.net/browse/HV

    3) Does it work on POJOs or Java Beans only?

    Bean Validation is intended for POJOs. The constraints are generally placed on class fields or getters (method following the Java Bean notation getXYZ, maybe that's where your confusion is coming from).