-->
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: entity access in custom Annotation/Validator
PostPosted: Thu Dec 11, 2008 7:10 am 
Newbie

Joined: Thu Dec 11, 2008 6:55 am
Posts: 2
Hello,

i have written a custom annotion (Validator) for validating an input value of a field. The problem is, that i need access to the entity itself (or to other fields of the entity) inside the Validator (in the isValid() method).

Because parameters of an annotation are not dynamic, i have no idea how to solve this problem.

Any idea ?

Thanks
Sebastian


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 11, 2008 8:30 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

you could write a entity level validator instead. In this case you would get the whole entity passed into isValid().

See http://forum.hibernate.org/viewtopic.php?t=992035.

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