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: How to Control Field updates ?
PostPosted: Mon May 04, 2009 4:48 pm 
Newbie

Joined: Mon May 04, 2009 1:51 pm
Posts: 1
I am new at Nhibernate and I have a question that i could not find the
answer yet. I have a User class that is saved via Nhinernate to a
database. When I update a "user" object everything works ok by using
an UpdateUser(User obj) method on my Service class. Now lets say that
on that UpdateUser method I don't want the "password" field to be able
to be change because I need more compex logic so i prefer to have a
ChangePassword(User obj, String NewPassword) method for changing it.
How can i control that mapping / update so the password wont generate
any update sql code on the UpdateUser method and it will update ok on
the ChangePassword method ? On my mind the same problem can occur in
many situations .. lets say i need a "LastLogin" date field that will
be updated internally on the login method but should not be updated on
the UpdateUser method. Any suggestions ?

Thanks in advance

George Statis


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.