-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Group sequence provider
PostPosted: Mon May 13, 2013 9:31 am 
Newbie

Joined: Mon May 13, 2013 9:13 am
Posts: 2
Hi Team,

I want to use group sequence provider in XML configuration. But I do not find any element in validation mapping XSD where I can provide group sequence provider.

I am using Hibernate 4.3.1 version.

Your immediate reply will be of much help to me.

Thanks in advance,
Sravanthi


Top
 Profile  
 
 Post subject: Re: Group sequence provider
PostPosted: Mon May 13, 2013 5:57 pm 
Hibernate Team
Hibernate Team

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

Group sequence providers are a Hibernate Validator specific feature which can't be configured via XML (the XSD is defined by the Bean Validation specification and it's not possible to add custom elements on the type level). You could alternatively use the programmatic configuration API. Example 11.6 in http://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/#section-programmatic-api shows you how to do that.

Hth,

--Gunnar

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


Top
 Profile  
 
 Post subject: Re: Group sequence provider
PostPosted: Mon May 13, 2013 11:29 pm 
Newbie

Joined: Mon May 13, 2013 9:13 am
Posts: 2
Gunnar,

thanks for your prompt reply.

i have one query w.r.t group sequence provider.

is there a way for me to do all the validations provided in the group sequence provider, since if a validation fails in first group, rest of validations in the other groups are not executed. My requirement is to do all the validations of all groups specified in group sequence provider.

thanks,
sravanthi


Top
 Profile  
 
 Post subject: Re: Group sequence provider
PostPosted: Tue May 14, 2013 12:14 pm 
Hibernate Team
Hibernate Team

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

I'm not sure whether I completely get your requirement.

It's the very purpose of a validation sequence to stop validation after the first group with a violation. If you want to validate several groups in one go, you may create one group which comprises all the required groups. To do so just create an interface which inherits the other groups:

Code:
public interface Complete extends Group1, Group2 {}


You can then return this group from your default group sequence provider. Does that answer your question? Otherwise an example of your use case might be helpful.

--Gunnar

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.