-->
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.  [ 2 posts ] 
Author Message
 Post subject: pass external dynamic parameters to validation
PostPosted: Tue Nov 24, 2015 4:08 pm 
Newbie

Joined: Tue Nov 24, 2015 3:57 pm
Posts: 1
Is there any way to pass a parameter to a validator. I don't want to hardcode my validation constants in the validation rule. For instance, I might want a minimum value to be 3 one day but 4 another day without modifying code. So I would like to pass in the minimum value from some external source, maybe something I maintain in a database or perhaps in a constants file.


Top
 Profile  
 
 Post subject: Re: pass external dynamic parameters to validation
PostPosted: Wed Nov 25, 2015 3:34 am 
Hibernate Team
Hibernate Team

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

The API for programmatic constraint declaration (see http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html_single/#section-programmatic-api) should be helpful to you.

Cheers,

--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.  [ 2 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.