Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Requests for Enhancement
PostPosted: Wed Apr 08, 2015 5:52 am 
Newbie

Joined: Wed Apr 08, 2015 5:25 am
Posts: 1
I have some requests for enhancement for the next version of Bean Validation. I'm not sure, if this is the correct forum. So please inform me, if I should post this somewhere else.

[list=]
[* Make validation constraints @Repeatable and mark *.List @Deprecated for better readability and easier parsing]
[* Add groups to @Valid for better control and better performance]
[* Add one single annotation like "@ValidationRule" to cover for any business rule and cross field validations. This annotation must be placed on a method. The method returns a set of constraint violations and either has no parameter (to validate 'this') or one single parameter (the root bean to validate). Should have groups and payload.]
[* Add a class level annotation "@Validator". This annotation accepts a list of classes for its value. This classes are parsed when validating an object of the so annotated class. All methods in the target class will be invoked which are annotated with "@ValidationRule" and which have one single parameter which is the class annotated with "@Validator". Should have groups and payload.]
[/list]


Top
 Profile  
 
 Post subject: Re: Requests for Enhancement
PostPosted: Thu May 07, 2015 7:35 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi,

Many thanks for your input!

Quote:
* Make validation constraints @Repeatable and mark *.List @Deprecated for better readability and easier parsing


Yes, that's on the list, though there is a challenge to make this backwards-compatible with JDK 7 (unless we decide to require at least Java 8). The @List annotations are still needed btw. so we cannot deprecate them. @Repeatable is just syntatic sugar: The compiler translates this into byte code using a "container annotation", so from the byte code level its no difference whether @List has been given explicitly or a repeatable annotation has been specified multiple times

Quote:
Add groups to @Valid for better control and better performance


What is your use case for this? Have you seen the feature of group conversion in BV 1.1 (http://beanvalidation.org/1.1/spec/#constraintdeclarationvalidationprocess-groupsequence-groupconversion)? Maybe this does what you are after.

Quote:
Add one single annotation like "@ValidationRule"


Could you give an example for how this would be used? In which way would this be superior to a custom class-level constraint?

Quote:
Add a class level annotation "@Validator". This annotation accepts a list of classes for its value


Could you give an example for this as well? I am not sure I fully understand this proposal.

Thanks a lot,

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
 Post subject: Re: Requests for Enhancement
PostPosted: Thu May 07, 2015 7:37 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Btw. sorry for the long delay. We are bit quicker to respond to mails sent to beanvalidation-dev. Check out this page with all the information: http://beanvalidation.org/contribute/

Cheers,

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.