Question

Bean Validation comes with those built-ins @Past and @Future. According to the specification those constraints are only supporting those old Date and Calendar classes. What are my options for using those Bean Validation built-ins with java.time?

Was it helpful?

Solution

A better place for asking this question would be the beanvalidation-dev List. Fortunately I did recently:

Supporting new Java 8 data types seems to be a good candidate for the next iteration of the Bean Validation spec. [..] However, in Hibenrate Validator we already started the work on supporting Java 8, including the new date and time types. Hibernate Validator 5.2 should make this functionality available, probably well before there will be a new spec version.

That will be the following options for you:

Disclaimer: I'm the author of that library.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top