-->
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.  [ 1 post ] 
Author Message
 Post subject: Is there an Annotation validation constraint for decimals?
PostPosted: Fri Jan 26, 2007 12:56 am 
Newbie

Joined: Wed Sep 13, 2006 2:44 pm
Posts: 6
Location: San Diego, CA
Checking the list of built-in validation constraints here
http://www.hibernate.org/hib_docs/annot ... s-built-in I couldn't spot one for validating a decimal value with scale and precision.

Should defining precision and scale on @Column be utilized during validation? I tried this, but it didn't seem to validate my values.

I presume I'll have to write a custom validator. Does anyone happen to have any links to an existing numeric validator?

I plan to create something like
Code:
@Decimal(precision=10, scale=3)

valid for BigDecimal, float and double.

Does this seem right?

Thanks,

Tim


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

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.