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

2009-03-11 Thread Emmanuel Bernard
I have gathered feedback from various places and as expected everyone has his favorite best solution. I am on the fence to support this: - @Max with long not supporting double and float - @MaxDecimal with String (BigDecimal style) not supporting double and float - same for min WDTY? Bett

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

2009-03-05 Thread Hardy Ferentschik
On Thu, 05 Mar 2009 10:30:49 +0100, Elias Ross 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 i

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

2009-03-05 Thread Elias Ross
On Wed, Mar 4, 2009 at 4:20 PM, Emmanuel Bernard wrote: > I mean we could but we would need to rely on the string representation > > @interface Max { >  String value() > } > > @Max("12.5") > double someNumber; There's very few domains where you want to be validating user input and storing it as

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

2009-03-05 Thread Sanne Grinovero
Using the String value could be a good idea also for double, not very clean but safe. 2009/3/5 Emmanuel Bernard : > I mean we could but we would need to rely on the string representation > > @interface Max { >  String value() > } > > @Max("12.5") > double someNumber; > > > On  Mar 4, 2009, at 19:1

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

2009-03-04 Thread Emmanuel Bernard
Unfortunately, you can't support Big* as they are not expressible in annotations @interface Max { BigDecimal value(); } does not compile. On Mar 4, 2009, at 19:14, Elias Ross wrote: On Wed, Mar 4, 2009 at 3:49 PM, Emmanuel Bernard > wrote: [Follow up with Sebastian] Well good point and

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

2009-03-04 Thread Emmanuel Bernard
I mean we could but we would need to rely on the string representation @interface Max { String value() } @Max("12.5") double someNumber; On Mar 4, 2009, at 19:17, Emmanuel Bernard wrote: Unfortunately, you can't support Big* as they are not expressible in annotations @interface Max {

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

2009-03-04 Thread Elias Ross
On Wed, Mar 4, 2009 at 3:49 PM, Emmanuel Bernard wrote: > [Follow up with Sebastian] > > Well good point and frankly I do not know :) > 1. do we support float and double for @Min / @Max? > 2. if 1 is yes, I'd be inclined to say the value should be double but that's > not fully automatic. How woul

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

2009-03-04 Thread Emmanuel Bernard
[Follow up with Sebastian] Well good point and frankly I do not know :) 1. do we support float and double for @Min / @Max? 2. if 1 is yes, I'd be inclined to say the value should be double but that's not fully automatic. PS: I don't think the issue is addressable per se, it has to be unders

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

2009-02-27 Thread Emmanuel Bernard
On Feb 27, 2009, at 15:11, Hardy Ferentschik wrote: On Fri, 27 Feb 2009 15:01:40 +0100, Emmanuel Bernard > wrote: values are of type long. Someone asked to move to double. What do you think? Kind of makes sense, since we allow to put @Min and @max onto decimal fields. Are there any disa

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

2009-02-27 Thread Hardy Ferentschik
On Fri, 27 Feb 2009 15:01:40 +0100, Emmanuel Bernard wrote: values are of type long. Someone asked to move to double. What do you think? Kind of makes sense, since we allow to put @Min and @max onto decimal fields. Are there any disadvantages or problems with moving to double? --Hardy

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

2009-02-27 Thread Emmanuel Bernard
values are of type long. Someone asked to move to double. What do you think? ___ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev