-->
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: field constraint and root bean
PostPosted: Fri Jan 29, 2010 11:59 am 
Newbie

Joined: Fri Jan 29, 2010 7:32 am
Posts: 2
Hi all,
dispite what specification say, it would be usefull to have a reference to the 'rootBean' object in case of a constraint applied to a field.
I used Oval (http://oval.sourceforge.net) as a framework for validation and I founded wery usefull to have a reference to the 'validatedObject' from inside, as Oval call it, my 'Check'.
Code:
public interface Check extends Serializable {
...
boolean isSatisfied(Object validatedObject,
                    Object valueToValidate,
                    OValContext context,
                    Validator validator)
                    throws OValException
...
}

Probably I am missing something.
Any suggestion?
Thanks.


Top
 Profile  
 
 Post subject: Re: field constraint and root bean
PostPosted: Fri Jan 29, 2010 1:14 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Nope, you won't get passed the root bean in a ConstraintValidator implementation. If you need the root bean you will have to use a class level validator.

--Hardy


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.