This is another omission in the API. I'll make sure this is added in
the next milestone. For now you can do something like that (untested!) -
Persistent clone = (Persistent) Util.cloneViaSerialization(object);
clone.setObjectContext(otherContext);
otherContext.getGraphManager().registerNode(clone.getObjectId(), clone);
> What is nodeId, is it objectId ?
Yes. I intentionally designed "graph" package to be generic,
independent from Cayenne.
Andrus
On Dec 19, 2005, at 7:16 AM, Marcin Skladaniec wrote:
> Hi
> This is probably a trivial question, but I couldn't find a
> solution. There is not much documentation, so I need to ask.
>
> I have encountered a problem with moving objects between two
> ObjectContexts. With DataContext it is possible to use localObjects
> (). What is the best way to move object between shared and
> dedicated context in 3t ? For now I'm re-fetching the object from
> db, but its not a good solution.
> I found a method registerNode(Object nodeId, Object node)? Could
> registering a node help? What is nodeId, is it objectId ?
>
>
> Cheers
> Marcin Skladaniec
>
This archive was generated by hypermail 2.0.0 : Mon Dec 19 2005 - 04:22:03 EST