It seems like a lot of people are unhappy with the current
behaviour, so I'm open to suggestions. The easiest way
may simply be to give the collection a reference to its
snapshot that it can carry around with it and re-use in new
sessions.

An even simpler solution (for collections of "immutable"
elemenst only) might be to just let the collection track
whether or not it was modified while "disconnected". That
would not allow us to track changes to _individual_
elements, but would at least avoid the removal of an
unmodified collection.

I am open to suggestions in this area.




                                                                                       
                                               
                    "Max Rydahl Andersen"                                              
                                               
                    <[EMAIL PROTECTED]>                            To:     <[EMAIL 
PROTECTED]>                           
                    Sent by:                                cc:                        
                                               
                    [EMAIL PROTECTED]       Subject:     [Hibernate] delete and then 
insert of M-N ...any solution ?  
                    eforge.net                                                         
                                               
                                                                                       
                                               
                                                                                       
                                               
                    28/01/03 06:33 PM                                                  
                                               
                                                                                       
                                               
                                                                                       
                                               




Hi!

Isn't there any means we can do to avoid having Hibernate perform a
complete
delete of the "helper-table" entries
when performing an .update() on such an mapping ? (It messes up any
triggering scheme or versioning of those helper-tables...)

Just suggestions here:

Could we optionally provide some way of having Hibernate keep track of
deletions, additions to the set representing the M-N ?
(e.g. having a "TrackableCollection" interface the set could implement and
if the set implement that one Hibernate listens to it ?)

interface TrackableCollection {
   List getDeletedObjects();
   List getAddedObjects(); // Maybe the "added" set is just those which is
transient/not-saved objects in the list?
}


Could we somehow have Hibernate support having a helper-table with more
data
than just the keys ?
Mainly here thinking on it also having a versionid and primarykey of it own
? In our app we would like to have optimistic locking
on those "links" and thus currently we have to model it as two
many-to-one's
instead of the much more friendlier "hidden-helper-table"....

Just thoughts...

/max



-------------------------------------------------------
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