[hibernate-dev] [Bean Validation] @Max / @Min as double instead of long

Hardy Ferentschik hibernate at ferentschik.de
Thu Mar 5 05:20:43 EST 2009


On Thu, 05 Mar 2009 10:30:49 +0100, Elias Ross <genman at noderunner.net>  
wrote:


> @Max("12.5")
> BigDecimal someNumber;
>
> Since the BigDecimal and BigInteger have String constructors that are
> well defined, a String representation seems fine.

The string representation is probably less intuative though, especially  
for int/Integer/long/Long. And of
course it is prone typos.

> There's other restrictions you may want to make as well. For instance,
> you may want to restrict values to at most N decimal places or
> significant digits, i.e. precision. This is useful in scientific
> applications. How might you represent that?

Is this not covererd by @Digits?

--Hardy





More information about the hibernate-dev mailing list