[hibernate-dev] [Bean Validation] Constraints plural

Emmanuel Bernard emmanuel at hibernate.org
Wed Feb 18 10:35:30 EST 2009


I have added the following plural forms
AssertFalses
AssertTrues
//Digits to be redefined
Futures
Maxs
Mins
NotNulls
Nulls
Pasts
Patterns
Sizes

As you can see not all names are pretty. Any improvement proposal?

Alternatively, we could define inner annotations to define the plural,  
ie

@interface Max {
   String message() default "...";
   Class<?> groups() default {};

   public static @interface Plural {
      Max[] value();
   }
}

@Max.Plural( {
    @Max(30, groups=JoeSixPack.class),
    @Max(100, groups=PowerUser.class)
} )

WDYT?



More information about the hibernate-dev mailing list