[hibernate-issues] [Hibernate-JIRA] Commented: (BVAL-235) Support parameterized payload attributes

Gerhard Petracek (JIRA) noreply at atlassian.com
Tue Sep 27 13:12:45 EDT 2011


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

Gerhard Petracek commented on BVAL-235:
---------------------------------------

fyi: bv payload is a subset of https://cwiki.apache.org/confluence/display/EXTVAL/Constraint+Aspects
we agreed on discussing about @ParameterKey and @ParameterValue later on.

> Support parameterized payload attributes
> ----------------------------------------
>
>                 Key: BVAL-235
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-235
>             Project: Bean Validation
>          Issue Type: New Feature
>          Components: spec-general
>    Affects Versions: 1.0 final
>            Reporter: Sebastian Thomschke
>
> JSR303's payload attribute values are limited to class references. 
> The idea is to allow the specification of an additional String value for each payload declaration allowing more flexible configurations.
> For example:
> public @interface Payload {
>     Class< ? > type();
>     String value();
> }
>  
> @interface MinLength {
>   Payload[] payload() default {};
>   // ...
> }
>  
> class Account
> {
>   @MinLength(value=4, payload = {
>      @Payload(type=ErrorCode.class, value="1234"),
>      @Payload(type=When.class, value="groovy:this.owner != null && this.foobar > 3")
>   })
>   String name;
> }

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