-->
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.  [ 1 post ] 
Author Message
 Post subject: Custom validator: access something besides the new value?
PostPosted: Wed Aug 02, 2006 6:30 pm 
Beginner
Beginner

Joined: Wed Nov 30, 2005 10:25 pm
Posts: 25
Is there anything within the hibernate validation framework that allows me to access the class instance and not just the property value?

I want to validate, using a hibernate validator, if a value is unique (there is a unique constraint in the database). Example: unique username for a User class.

I can put a custom annotation on the username property, and I will get the username value in the validator, but I can't get access to the User object to see if the value has changed or the primary key of the user to see if there is already one in the database.

Is there anyway to do this?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.