[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-150) Consider higher level validations, such as email, URL, credit card, etc.

Ted Bergeron (JIRA) noreply at atlassian.com
Fri Apr 13 13:45:04 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_26713 ] 

Ted Bergeron commented on ANN-150:
----------------------------------

ISBN is very specific, and may not be necessary.  I suggested it only because commons validator offered that.  I think URL and URI would be useful.  Really, the more validators that come out of the box, the more useful it is.  Latitude and Longitude validators might be useful.  In situations where developers tend to use basic types (String, Double, etc) to model more meaningful fields, such as Email, a validator pattern would be useful.  A developer may use a coordinate class that has Lat/long/altitude, and may include the validation logic within.  Alternatively, they may just use 2 Strings.  If we think using a basic type is a common approach, ideally we'd have a validator for these cases.



> Consider higher level validations, such as email, URL, credit card, etc.
> ------------------------------------------------------------------------
>
>                 Key: ANN-150
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-150
>             Project: Hibernate Annotations
>          Issue Type: New Feature
>          Components: validator
>    Affects Versions: 3.1beta6
>            Reporter: Ted Bergeron
>            Priority: Minor
>
> I was looking at the release notes for commons validator 1.2 http://wiki.apache.org/jakarta-commons/ValidatorVersion120  and wondered if the higher level constructs fit the design goals of hibernate validator.
> They have email, URL, Credit card and ISBN.  These could all be handled via @Pattern with regex matching a constant declared somewhere.
> Would it be desirable to have Hibernate supply the values for these constants? Such as:
> @Pattern(type="email") or @Pattern(regex=org.hibernate.validator.Pattern.EMAIL) or @Email
> Email and URL are global patterns.  This probably wouldn't work for something like phone number which is locale sensitive.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list