[hibernate-issues] [Hibernate-JIRA] Issue Comment Edited: (BVAL-220) Offer stereotypes to skip validation on empty or null

Peter Davis (JIRA) noreply at atlassian.com
Tue Jun 21 00:38:54 EDT 2011


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

Peter Davis edited comment on BVAL-220 at 6/20/11 11:38 PM:
------------------------------------------------------------

Suggestion:

@ReportAsSingleViolation(shortCircuit=true) /* better name? */
@NotNull /* or @NotEmpty, or @Size(min=50)... */
@Constraint(validatedBy=MyValidator)
public @interface MyConstraint {}

Currently Hibernate Validator invokes MyValidator even if the value is null.  This is wasteful and pointless.  It also makes it hard to compose cheap vs. expensive validations, or prerequisite validations in a reusable way.  I don't believe this is addressed by the recent "OR" composition type addition to HVAL.

      was (Author: pediddle):
    Suggestion:

@ReportAsSingleViolation(shortCircuit=true) /* better name? */
@NotNull /* or @NotEmpty, or @Size(min=50)... */
@Constraint(validatedBy=MyValidator)
public @interface MyConstraint {}

Currently Hibernate Validator invokes MyValidator even if the value is null.  This is wasteful and pointless.  It also makes it hard to compose cheap vs. expensive validations.  I don't believe this is addressed by the recent "OR" composition type addition to HVAL.
  
> Offer stereotypes 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.
-
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