Hibernate Validator 4.2.0.Final

Posted by    |      

Time to update your dependencies or to hit the download site. Hibernate Validator 4.2.0.Final is released. All artifacts are either available via the JBoss Maven Repository or SourceForge. Links to the latest documentation can be found on the Validator homepage.

We have been blogging about the different new features and major changes during the interim releases, so let me just remind you. The most important new features are:

  • method level validation
  • boolean composition for composed constraints via @ConstraintComposition
  • ValueFormatterMessageInterpolator
  • GroupSequenceProvider annotation for the dynamic definition of the default group sequence

You can find more information about these features in the release blogs for Hibernate Validator 4.2.0 Beta1 and Hibernate Validator 4.2.0 Beta2.

The feature which underwent most changes during the development of Hibernate Validator 4.2.0 was the programmatic configuration API. In order to add programmatic configuration for method level validation and group sequence providers we had to go through several iterations. The final result is described in Hibernate Validator 4.2.0 CR1. We are sorry if you had to change your mappings several times, but we believe the outcome is worth it :-)

Even though we did not plan to add any new features after CR1, we introduced - thanks to a last minute contribution - a new constraint annotation - @SafeHtml. This constraint allows to check whether a given character sequence contains potentially malicious html code. Check the online docs for more information.

It is also important to know that together with Hibernate Validator 4.2.0.Final a new version of the Bean Validation TCK was released (1.0.5.GA). You find the latest documentation of the TCK here. The TCK contained wrong tests related to the Node.Path API (BVTCK-12) and it also checked wrongly for a ValidationException in case a constraint is placed on a non getter method (BVTCK-14).

You can find more information on how to upgrade Hibernate Validator on the Hibernate Validator Migration Guide.

The full change log for this release is available here. Feedback is welcome via the Validator Forum and the Jira issue tracker.

Last, but not least, this release would not have been possible without the help from the community. Thanks in particular to Dag, Frederico, George, Gunnar and Kevin!

Enjoy!


Back to top