[hibernate-issues] [Hibernate-JIRA] Commented: (BVAL-220) Offer possibiltiy to skip validation on empty or null

Emmanuel Bernard (JIRA) noreply at atlassian.com
Thu Jan 26 10:31:10 EST 2012


    [ http://opensource.atlassian.com/projects/hibernate/browse/BVAL-220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45261#comment-45261 ] 

Emmanuel Bernard commented on BVAL-220:
---------------------------------------

The goal of this issue is to let people declaratively say that a constraint should not be executed if the value is null or empty. This avoids the famous

{code}
boolean isValid(T value, ...) {
    if (value == null) return true;
}
{code}

I now realize that Peter's suggestion would raise an ConstraintViolation if the constraint is applied on a null value which is not what I had in mind. We could work around that with a property on @RepostAsSingleViolation or as another explicit annotation @IgnoreConstraintOnFailingSubConstraints (or something like that).

> Offer possibiltiy to skip validation on empty or null
> -----------------------------------------------------
>
>                 Key: BVAL-220
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-220
>             Project: Bean Validation
>          Issue Type: New Feature
>          Components: spec-general
>            Reporter: Emmanuel Bernard
>
> https://issues.apache.org/jira/browse/EXTVAL-74

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list