-->
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.  [ 2 posts ] 
Author Message
 Post subject: One-line Validator annotation...
PostPosted: Fri Dec 23, 2005 5:14 pm 
Beginner
Beginner

Joined: Sat Sep 17, 2005 10:41 am
Posts: 49
It might be worthwhile to consider a one-line validator annotation. In place of

@NotNull
@Length (min = 1, max = 100)
@Pattern (regex = "[A-Z]*")
private String someAttribute ;

We could have something like:

@Validate (nullable = false, minLength = 1, maxLength = 100, regex = "[A-Z]*")
private String someAttribute ;

With some sensible defaults...
boolean nullable default true
int minLength default -1
int maxLength default -1
String regex default null


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 23, 2005 5:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
What is wrong with:

@NotNull @Length (min = 1, max = 100) @Pattern (regex = "[A-Z]*")
private String someAttribute ;

and furthermore @Validate would not provide very good compile validation/code completion.

_________________
Max
Don't forget to rate


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