2010/3/30 Emmanuel Bernard <emmanuel(a)hibernate.org>
I like the idea.
Initially we've decided to not add them and were waiting for the
do you know the status and expected release?
JSR 310 was in Early Draft Review stage from 26 Feb till 28 Mar. It's
planned to be included in Java 7, though AFAIK it's not totally sure whether
this is really going to happen. As Joda is quite widely in use I think it
would be nice to have support for it in Hibernate Validator. Once JSR 310 is
final, support for it could be added to HV, and surely also to the BV spec.
The main problem I see is that we would likely use the same annotations for
both joda and the jsr-310.
We could think of using @Constraint and use two validator implementations
but unfortunately that would fail at runtime if we don't have Joda Time in
Anyone has an idea to work around that?
I thought about supporting the standard BV @Past/@Future annotations at
Joda/JSR 310 types with Hibernate Validator. In that case the validator(s)
for Joda/JSR 310 might be registered automatically by HV (as all validators
for annotations from the BV API), probably after some reflective checking
whether Joda/JSR 310 is present in the class path or not.
Alternatively one could provide one/two constraint-mapping XML file(s) to be
delivered with Hibernate Validator, which users might add to their
validation.xml in case they want to work with Joda/JSR 310.
The second approach is more in line with the concepts of customization
defined by BV, while the first is probably more comfortable for Hibernate
On 24 mars 2010, at 22:40, Gunnar Morling wrote:
> for Hibernate Validator 4.1 we are planning to add some new constraints.
> this context Hardy and I discussed whether it might be worth to add
> for the date/time types from the Joda Time API (
) for the @Past/@Future standard
> I think Joda is quite popular these days, and the upcoming JSR 310 is
> heavily influenced by Joda, too (the spec lead is also the lead of Joda).
> this might add value for users, OTOH such support might be too specific.
> there any opinions on this?
> Thanks, Gunnar
> hibernate-dev mailing list