-->
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.  [ 5 posts ] 
Author Message
 Post subject: Annotate Float Precision
PostPosted: Wed May 07, 2008 1:54 pm 
Beginner
Beginner

Joined: Wed Mar 05, 2008 10:32 am
Posts: 48
How do i annotate the precision of a float object?
Using Annotations and Validator.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 07, 2008 2:01 pm 
Beginner
Beginner

Joined: Wed Mar 05, 2008 10:32 am
Posts: 48
Nevermind..

@Column(nullable = true, precision = 6)

I believe this should work. Have not tested but on a table describe i still see the type as float w/out the percision number.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 08, 2008 2:42 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
you should try
Code:
@Digits
or
Code:
@Max(value=)


As you can see on the table at http://www.hibernate.org/hib_docs/validator/reference/en/html_single/ the @Digits also applies the precision on the table.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 08, 2008 10:41 am 
Beginner
Beginner

Joined: Wed Mar 05, 2008 10:32 am
Posts: 48
Would this replace or suppliment my previous code?

So for latitude and longitude...
@Digits(fractionalDigits = 6, integerDigits = 3) ???


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 08, 2008 11:03 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
yes, that should set both scale and precision on your physical mapping.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.