-->
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: <property update="false"> override in runtim
PostPosted: Tue Mar 16, 2004 12:17 pm 
Newbie

Joined: Fri Feb 20, 2004 7:37 am
Posts: 12
I would like to have a property specified update="false" in almost every case. But there is exactly one business method where I want to update this value in the database.

Why do I want to do that?
Well, my persistent object is a User-object and the property is the user password. I'd like to set the password on user creation/insert - so I leave the <property insert="true">.
The persistent object doesn't have a public getPassword()-getter because I don't want to make the password readable.
I have to copy/pass the persistent object to other "higher-level" business objects but now I can't copy/pass the password. When updating the business object (the underlying persistent object) I want everything getting updated but not the password. That's why I want to specify update="false" in the mapping file.
But of course there is a changePassword(old, new)-method where I need to update the password-field!

So my question: Is it possible to force the property to update="true" during execution of the changePassword-method (before the session.update(obj)) and revert it back after the update?

Many thanks for your help!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 10:38 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
No. The mapping is read and freeze at sessionfactory built

_________________
Emmanuel


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.