EDataGraph for Subparts of SDO [message #401472] |
Thu, 01 June 2006 09:04 |
Eclipse User |
|
|
|
Originally posted by: jens.mittag.prime23.de
Hi!
In my model, I have a root object, which contains a few child objects.
Now, I would like to put each of these child objects into an EDataGraph
- no problem so far. But when I serialize such an EDataGraph, all
siblings are serialized into the XML file as well. How can I prevent this?
The idea behind this is: I want to be able to track changes on the whole
model, and on specific subparts. So, when I want the changes of a
subpart, I only get those changes.
Thanks in advance.
|
|
|
|
Re: EDataGraph for Subparts of SDO [message #401476 is a reply to message #401475] |
Thu, 01 June 2006 12:06 |
Eclipse User |
|
|
|
Originally posted by: jens.mittag.prime23.de
Hmm...
Does this imply that the root object doesn't have a reference to its
children? ...or do I only have to remove the containment for the
association?
Imagine the following situation:
root-object -> child #1
-> child #2
If I do not use containment for the association, child#1 and child#2 are
in their own Resource and can be serialized seperately. If I want to
serialize the root-obj. with all the cildren, I do
root.eResource().getContents().add(child); for each child and then save
it. Or how would you do this?
Thanks
Jens
Ed Merks wrote:
> Jens,
>
> Things that you want serialized separately need to be in separate
> resources. You could just attach a ChangeRecorder to the root of any
> subtree and record only the changes within that...
>
>
> Jens Mittag wrote:
>
>> Hi!
>>
>> In my model, I have a root object, which contains a few child objects.
>> Now, I would like to put each of these child objects into an
>> EDataGraph - no problem so far. But when I serialize such an
>> EDataGraph, all siblings are serialized into the XML file as well. How
>> can I prevent this?
>>
>> The idea behind this is: I want to be able to track changes on the
>> whole model, and on specific subparts. So, when I want the changes of
>> a subpart, I only get those changes.
>>
>> Thanks in advance.
|
|
|
Re: EDataGraph for Subparts of SDO [message #401477 is a reply to message #401476] |
Thu, 01 June 2006 12:37 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Jens,
In EMF 2.2 there is support for cross resource containment as well
(EReference.resolveProxies set to true and GenModel's Contaiment Proxies
property set to true) so that child #1 could be in a separate resource
or, if it's not, it will be serialized as a child of root-object. The
approach of using a non-containment resource you outline would work too.
Jens Mittag wrote:
> Hmm...
>
> Does this imply that the root object doesn't have a reference to its
> children? ...or do I only have to remove the containment for the
> association?
>
> Imagine the following situation:
>
> root-object -> child #1
> -> child #2
>
>
> If I do not use containment for the association, child#1 and child#2
> are in their own Resource and can be serialized seperately. If I want
> to serialize the root-obj. with all the cildren, I do
> root.eResource().getContents().add(child); for each child and then
> save it. Or how would you do this?
>
> Thanks
> Jens
>
> Ed Merks wrote:
>> Jens,
>>
>> Things that you want serialized separately need to be in separate
>> resources. You could just attach a ChangeRecorder to the root of any
>> subtree and record only the changes within that...
>>
>>
>> Jens Mittag wrote:
>>
>>> Hi!
>>>
>>> In my model, I have a root object, which contains a few child
>>> objects. Now, I would like to put each of these child objects into
>>> an EDataGraph - no problem so far. But when I serialize such an
>>> EDataGraph, all siblings are serialized into the XML file as well.
>>> How can I prevent this?
>>>
>>> The idea behind this is: I want to be able to track changes on the
>>> whole model, and on specific subparts. So, when I want the changes
>>> of a subpart, I only get those changes.
>>>
>>> Thanks in advance.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03253 seconds