Hibernate Validator 5.4.0.CR1

Posted by    |      

I am proud to announce the release of Hibernate Validator 5.4.0.CR1. This is a candidate release, please take the time to test it and report any issues you might find so that we can build the best possible 5.4.0.Final.

What’s new

5.4.0.CR1 is a small release built on the shoulders of our previous beta. It contains a couple of nice improvements and bugfixes:

  • We improved the javax.money support with a new annotation @Currency

  • Marko Bekhta finished his work on the annotation processor: we are now on a par with the Hibernate Validator engine features

  • We also fixed a possible overflow issue in java.time validation reported by Stanislav Bashkyrtsev

You can find the complete list of all addressed issues in the change log.

Playing with @Currency

In Beta1, we introduced the ability to validate your Order bean containing a MonetaryAmount property with the @DecimalMin annotation. Starting from CR1, you can also use the @Currency annotation to specify the currencies allowed:

public class Order {

    @NotBlank
    private String name;

    @DecimalMin(value = "0", inclusive = false)
    @Currency("EUR")
    private MonetaryAmount amount;

    public JavaxMoneyOrder(String name, MonetaryAmount amount) {
        this.name = name;
        this.amount = amount;
    }
}

JDK 9 support

As usual, we are working on validating the releases of Hibernate Validator with the latest JDK 9 early access builds.

5.4.0.CR1 is supported on the JDK 9+148 build. However, a blocking issue in JDK 9 prevents it to run on +151. It should be fixed in the next JDK 9 release.

Getting 5.4.0.CR1

To get the release with Maven, Gradle etc. use the GAV coordinates org.hibernate:{hibernate-validator|hibernate-validator-cdi|hibernate-validator-annotation-processor}:5.4.0.CR1.

Alternatively, a distribution bundle containing all the bits is provided on SourceForge (TAR.GZ, ZIP).

Feedback, issues, ideas?

To get in touch, use the usual channels:

What’s next?

The obvious next step is the 5.4.0.Final release.

As far as Bean Validation 2.0 is concerned, there are very interesting discussions going on about value extraction which is THE big BV 2.0 feature. Come and join us on Bean Validation website to define the future of Bean Validation.


Back to top