[hibernate-issues] [Hibernate-JIRA] Commented: (HV-463) Revisit the class and implementation of GroupChain

Hardy Ferentschik (JIRA) noreply at atlassian.com
Tue Apr 19 13:01:59 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HV-463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=42094#action_42094 ] 

Hardy Ferentschik commented on HV-463:
--------------------------------------

The intention and working of _ensureDefaultGroupSequenceIsExpandable_ and _assertDefaultGroupSequenceIsExpandable_ are quite cryptic and at the very least should be better documented. the whole idea is to prevent un-expandable sequences due to entities re-defining the default group sequence.

{code}
@GroupSequence({ A.class, B.class, C.class, Default.class })
public interface ABCSequence {
}
{code} 

{code}
@GroupSequence({ MyEntity, A.class })
public class MyEntity{
}
{code}

{code}
...
Set<ConstraintViolation<MyEntity>> constraintViolations = validator.validate( myEntity, ABCSequence.class );
...
{code}

This really leads to a conflict. _ABCSequence.class_ is requested, but together with the default group redefinition we would get the following sequence: _A.class, B.class, C.class, Default.class, A.class_ which is not possible. If the default group sequence on _MyEntity_ would be _C.class, MyEntity_ it would be ok.
The code in GroupChain tries to evaluate exactly this, but is hard to understand w/o background. Either we refactor or at least document better.
We might also think about a better name than _Group_, because this class contains the concept of group and sequence. Maybe _GroupWithSequence_!?

> Revisit the class and implementation of GroupChain
> --------------------------------------------------
>
>                 Key: HV-463
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-463
>             Project: Hibernate Validator
>          Issue Type: Improvement
>          Components: engine
>    Affects Versions: 4.x
>            Reporter: Kevin Pollet
>


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