-->
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.  [ 4 posts ] 
Author Message
 Post subject: Password fields
PostPosted: Thu Jun 01, 2006 4:11 pm 
Regular
Regular

Joined: Sun Feb 12, 2006 10:18 pm
Posts: 60
Location: Rosario, Argentina
I have a Class, "User", which has the field "Password". I don't want to have the property accesible EVERY time I have to handle a User, but I do want to use NHibernate for persisting ALL the data, even the password. I was planning on using specific functions for changing the password, but a question arised: is it possible to map the class User in such a way that I can NOT LOAD the password for usual class handling, but DO LOAD it when I want to use the function for password changing?
In case you are wondering, I do save the password encrypted, but still I don't like carrying it around all the time...

Thanks!
Alejandro.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 01, 2006 4:28 pm 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
you could factor the password into its own class map the class as lazy="true" and create a <one-to-one outer-join="false"> mapping to it from the member object...

-devon


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 03, 2006 9:20 am 
Regular
Regular

Joined: Sun Feb 12, 2006 10:18 pm
Posts: 60
Location: Rosario, Argentina
So, if I have this lazy property and I want to use it, how do I load it into the "User" class when I need it? I open and close the sessions when I load a class.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 05, 2006 11:21 am 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
if your session is closed, and you need to load the one-to-one, then you will probably have to re-open the session and call session.Lock().


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