If you don't want the save() to cascade, you should set cascade="none" or
cascade="delete" on the association to User.

(Also, as long as unsaved-value is correct, the save() will cascade to an
update() of the User, which is okay usually.)




                                                                                       
                                               
                    "Justen Stepka"                                                    
                                               
                    <[EMAIL PROTECTED]>                    To:     <[EMAIL PROTECTED]> 
                                
                    Sent by:                                cc:                        
                                               
                    [EMAIL PROTECTED]       Subject:     [Hibernate] dependent object 
that is a reference to another  
                    eforge.net                               hibernate object          
                                               
                                                                                       
                                               
                                                                                       
                                               
                    05/02/03 11:54 AM                                                  
                                               
                                                                                       
                                               
                                                                                       
                                               




I am having a problem with my already existing objects being persisted into
the database when I call saveOrUpdate().

What happens is that I am putting the User object into my servlet session
so
that I can access the values of the account on the view (JSP pages). When I
call on an operation later in the system I may grab that User object out of
the session to set the value into a new object that is later persisted with
hibernate by calling saveOrUpdate().

This is where the problem occurs... when I save that new object with the
User object as a reference it is being repersisted rather than looking at
the identy field and seeing that the row/data in the datastore as the same
object.

Is there a way to force hibernate to look at the existing identify field on
the object I am setting rather than resave the existing object over again?

Thanks.



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel




**********************************************************************
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**********************************************************************





-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Reply via email to