-->
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: How to use Hibernate Validator for validate longs ? @Max
PostPosted: Wed May 02, 2007 12:12 pm 
Beginner
Beginner

Joined: Fri Jan 14, 2005 7:47 am
Posts: 37
Location: Spain
Hi,

I try to use @Max for validating my long property, in this way:
Code:
@Max(9999999999)
private long number;


But a compiling error is shown on my 9999999999. Obviously @Max only supports ints.

Are there plans to extend @Max for supporting longs ?
Is there some other Hibernate Validator annotation for checking long values ?

Hibernate Validator version: Hibernate Validator 3.0.0 GA

Thank you in advance
Javier Paniza


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 02, 2007 1:20 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Write your own annotation and validator, it's fairly easy.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: How to use Hibernate Validator for validate longs ? @Max
PostPosted: Wed May 02, 2007 1:25 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
javierpaniza wrote:
But a compiling error is shown on my 9999999999. Obviously @Max only supports ints.

Actually you're obviously wrong ;-)

Try 9999999999l

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: How to use Hibernate Validator for validate longs ? @Max
PostPosted: Wed May 02, 2007 2:06 pm 
Beginner
Beginner

Joined: Fri Jan 14, 2005 7:47 am
Posts: 37
Location: Spain
emmanuel wrote:
Actually you're obviously wrong ;-)


Actually I'm obviosly wrong.
Sorry! It's my fault!

Your validator works fine with longs!
The next time I'll go to the annotation source first!

Thanks!


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.