-->
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.  [ 3 posts ] 
Author Message
 Post subject: Validation code on setter methods
PostPosted: Thu Feb 26, 2004 9:23 am 
Newbie

Joined: Wed Sep 24, 2003 7:37 am
Posts: 6
Location: Bologna (ITALY)
I have very complex objects in which I want to validate properties value setted through the use of setter methods.
I know that the method call is also used by Hibernate in order to set the property value.
While i whish that the client library will be stopped if it try to set wrong data in a property, I don't want to introduce overhead to Hibernate load method.

Any suggestion?
thanks.

Mauro.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2004 9:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can use access=field or implement an additional private set/get pair without the validation logic.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2004 9:36 am 
Newbie

Joined: Wed Sep 24, 2003 7:37 am
Posts: 6
Location: Bologna (ITALY)
Another question is: it's a good design or it's best to do validations in some other places (e.g. DAO or the Validation callback?).


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