2009/6/19 Yevhen.Bobrov <[email protected]>

>
> I've tried creating fresh session and using SaveOrUpdateCopy to get
> back clone.
> But the problem I see now (maybe a bug until someone can prove that
> this is by design) that SaveOrUpdateCopy do not create clones of
> collections.


The method is session.Merge and its behaviour depend on cascade in the
mapping.
The Merge work with entities so what you will have is each entity merged
even if inside a collection.
If you want a completely new instance with DB values you should use Refresh
(another time refresh work depending on cascade in the mapping).

Btw what you should do is a deep copy... annoyed to do it by your self ?
well... what we should do ?
If you want an easy implementation of DeepCloner it is very easy. Define all
your entities as Serializable, manage the serialization attributes where
needed, and use the BinaryFormatter.

-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to