[bv-dev] Feature Suggestion :: Implicit constraints

Emmanuel Bernard emmanuel at hibernate.org
Tue Jul 29 12:10:18 EDT 2014


On 29 Jul 2014, at 18:01, Richard Fanning <Richard.Fanning at FINEOS.com> wrote:
> 
> Another scenario in our company where we thought this feature might be useful was again around the area of defaults. So for example a String property on an @Entity would not need to define any @Size but a sensible default (255) would apply akin to JPA providers [1]
>  
> But we’d still like to get ConstraintViolations during validation phase rather than some JPA/DB errors complaining about the strings length.

Actually, I’ve been trying to convince the JPA EG to do the opposite. The @Column(lengh) would be guessed by @Size(max=200) to avoid repetition. But I have had some resistance on this approach.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20140729/90b7bba0/attachment.html 


More information about the beanvalidation-dev mailing list