|
@Lorber Sebastien: Yes, that's not elegant indeed, but might be a workaround for the time being. Probably I'd create custom constraints such as @AfterCurrentDay and @BeforeCurrentDay with corresponding validators in this situation. As Hardy said, you might want to create an issue for the BV specification to consider this feature in the next spec update.
@Hardy Ferentschik: One possible idea could be to provide an annotation in HV, such as @ValidatedDateResolution which could be used to specify the resolution to be considered for the date constraints:
@ValidatedDateResolution(Resolution.DAY)
@Future
private Date date;
I think having a separate annotation is feasible here as it is very unlikely that several @Future annotations are given on the same element and thus no ambiguities are to be expected. That said, I'm not sure whether such an addition really would be worth it, given that the case can quite easily be solved using a custom constraint. WDYT?
|