Red Hat
Feb 6, 2013
by Hardy Ferentschik

Playing catchup with last week's Bean Valdiation specification release (1.1.0.Beta3) we are happy to make the following releases available as well:

Bean Validation TCK 1.1.0.Beta3

  • Maven artefacts on the JBoss Maven repository under the GAV org.hibernate.beanvalidation.tck:beanvalidation-tck-tests:1.1.0.Beta3
  • Zip and tar bundles on SourceForge

Hibernate Validator 5.0.0.Beta1

Given that the specification addressed 38 issues in its latest release, we were not quite able to sync the TCK and RI completely. There are still some missing TCK tests and the RI has missing features as well. For example, the XML configuration of method validation is still work in progress (see HV-373).

The TCK addresses 6 issues and Hibernate Validator 36. In case you are wondering, the main work in the TCK was the addition of test for new Bean Validation 1.1 features. This was addressed in BVTCK-32 which alone has 12 pull requests. Feel free to review the tests to verify that we are on the right track ;-)

Most notably we are behind with documentation though. Both, the TCK docs as well as the Hibernate Validator docs could need some love. Ever wanted to contribute, but did not know how? Here is your chance! Contact us via email or use the issue tracker.

Last but not least, here is a little teaser about what is new in this release. As of HV-676 it is now possible to use the Unified Expression Language (UEL) in the constraint message descriptors. We offered something in this direction before with ValueFormatterMessageInterpolator (which is by the way deprecated now), but there we offered only a way to format the validated value. Now you can interpolate the constraint annotation paramters as well and you can navigate the objects via the dot notation. And you can even have conditional messages. Here are a couple of examples:

    # ternary operator for conditional DecimalMax constraints - see also HV-256
    javax.validation.constraints.DecimalMax.message  = must be less than ${inclusive == true ? 'or equal to ' : ''}{value}

    # a custom date range annotation with custom formatted validated date
    com.acme.DateRange.message = the specified date ${formatter.format('%1%tY-%tm-%td', validatedValue)} lies not between formatter.format('%1%tY-%tm-%td', min)} and formatter.format('%1%tY-%tm-%td', max)}
There is another release at least of Hibernate Validator planned for next week. So stay tuned.