[hibernate-issues] [Hibernate-JIRA] Commented: (HV-381) Provide a fail fast switch to stop processing constraints on first failure
Emmanuel Bernard (JIRA)
noreply at atlassian.com
Wed Feb 9 17:21:05 EST 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HV-381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39903#action_39903 ]
Emmanuel Bernard commented on HV-381:
-------------------------------------
another approach is to make maxFailure a method only available on the object returned by failFast. That way, people cannot get confused by what Gunnar is pointing out.
WRT the last comment by Gunnar, I think that
{code}
final Validator validator = factory.unwrap( HibernateValidatorFactory.class )
.usingContext()
.failFast( true )
.maxFailures(5)
.getValidator();
{code}
is more readable than
{code}
final Validator validator = factory.unwrap( HibernateValidatorFactory.class )
.usingContext()
.maxFailures(5)
.getValidator();
{code}
We can even think about using failFast() instead of failFast(boolean)
The drawback of that approach is that it's a bit harder on generic users of the programmatic API (ie the one having a failFast boolean).
> Provide a fail fast switch to stop processing constraints on first failure
> --------------------------------------------------------------------------
>
> Key: HV-381
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-381
> Project: Hibernate Validator
> Issue Type: Bug
> Components: engine
> Affects Versions: 4.1.0.Final
> Reporter: Emmanuel Bernard
> Assignee: Kevin Pollet
> Fix For: 4.2.0.Beta2
>
>
> On first failure, HS should stop processing constraint failures and return straight.
> This should be both a {{ValidatorFactory}} setting and a {{Validator}} setting.
--
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