-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: @Min, @Max support for double/float?
PostPosted: Fri Jan 23, 2009 1:57 pm 
Newbie

Joined: Tue Nov 21, 2006 6:46 pm
Posts: 6
I was trying to annotate a double field with (@Min,@Max) and discovered that it is limited to long values only (compiler simply fails with "possible loss of precision" error)

Also do not see the @Range annotation in the api.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 27, 2009 4:22 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
The idea is to let you (or your bean validation provider) write these custom Min / Max / Range proposals.

I was always scared about the risk of rounding errors that could happen if we introduced double in these annotations. What do others think?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 3:45 pm 
Newbie

Joined: Tue Nov 21, 2006 6:46 pm
Posts: 6
I think the validation framework should not care of possible rounding problems. It is the problem of the domain developer who ultimately sets up ranges and cares of possible precision losses.
Also consider input parameters entered manually by human, there is no rounding going on at all in this case.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 13, 2009 9:00 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I noted the point.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.