[hibernate-issues] [Hibernate-JIRA] Commented: (BVAL-176) No way to add custom error from collection validator to item

Alexey Romanchuk (JIRA) noreply at atlassian.com
Mon Aug 17 06:03:15 EDT 2009


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

Alexey Romanchuk commented on BVAL-176:
---------------------------------------

Here it is short example. 

class Item
{
  @Valid
  @NoItersectedIntervals
  Collection<Interval> intervals;
}


@StartLessThatEnd
class Interval
{
  int start; 

  int end;
}

When it implement @NoItersectedIntervals I want to add ConstraintViolation for intervals[i].start and intervals[i].end fields of intersected intervals. But API does not allow me to add index for validated field.

> No way to add custom error from collection validator to item
> ------------------------------------------------------------
>
>                 Key: BVAL-176
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-176
>             Project: Bean Validation
>          Issue Type: New Feature
>          Components: spec-general
>            Reporter: Alexey Romanchuk
>            Assignee: Hardy Ferentschik
>
> Assume we have object, that contains collection of items. This collection itself contains some business restriction like every item should have unique name. I create validator for this collection and want to add custom ConstrainViolation on each collection element that causes this violation. Now by API I can only use inIterable only for subnodes. 
> The solution is to allow inIterable for ErrorBuilder

-- 
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