|Re: Utility to copy CDOObject data only [message #1006609 is a reply to message #1006582]
||Fri, 01 February 2013 07:17
| Eike Stepper
Registered: July 2009
Am 31.01.2013 23:08, schrieb Andrew Whelan:|
> Lets say I have 2 CDObjects, object1 and object2.
> Is there a CDOUtility
> copy(object2, object1)
> that will allow me to copy only the data elements of object1 into object2 but yet wont effect any of the CDO plumbing
> of object2(CDOID, CDOView, etc)?
No, the copy of an object is always detached from the graph, which in CDO implies that it's TRANSIENT (i.e., view==null,
> I'd like to keep the CDOTransaction and CDOSession of object2 intact. I just want to update its data with that of
That's not possible, because the container reference is implicitely bidirectional and leaving it intact would imply to
add the object to the containment reference of its container.
> I was wondering if this is something I need to write myself.
Yes, only you can decide where to attach/add the copied object.
> object2 = EcoreUtil.copy(object1)
> Will obviously hose all of the CDO plumbing.
Yes, and the EMF plumbing (the container reference), too.
Powered by FUDForum
. Page generated in 0.01625 seconds