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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top