Skip to main content



      Home
Home » Modeling » EMF » Utility to copy CDOObject data only(Utility to copy CDOObject data only)
Utility to copy CDOObject data only [message #1006582] Thu, 31 January 2013 17:08 Go to next message
Eclipse UserFriend
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)? I'd like to keep the CDOTransaction and CDOSession of object2 intact. I just want to update its data with that of object1. I was wondering if this is something I need to write myself.

 object2 = EcoreUtil.copy(object1)


Will obviously hose all of the CDO plumbing.
Thanks
-Andrew
Re: Utility to copy CDOObject data only [message #1006609 is a reply to message #1006582] Fri, 01 February 2013 02:17 Go to previous message
Eclipse UserFriend
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,
id==null).

> I'd like to keep the CDOTransaction and CDOSession of object2 intact. I just want to update its data with that of
> object1.
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.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Previous Topic:[CDO] CDOTransaction.close
Next Topic:[CDO] Installation of CDO 4.2 failed
Goto Forum:
  


Current Time: Wed Jul 02 14:13:46 EDT 2025

Powered by FUDForum. Page generated in 0.23297 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top