|
Re: Opposite and many to many [message #1240948 is a reply to message #1237393] |
Fri, 07 February 2014 09:01 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
Ludovic,
Comments below.
On 29/01/2014 4:48 PM, lca wrote:
> Hello guys,
> i'm using EMF and i've got the following weir behavior, maybe you
> might help me.
>
>
> I have 2 opposites features many-to-many in on of my EClass.
>
> here is the ecore definition of my features:
>
> <eStructuralFeatures xsi:type="ecore:EReference" name="parent"
> upperBound="-1"
> eType="#//DataSet" resolveProxies="false"
> eOpposite="#//DataSet/child"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="child"
> upperBound="-1"
> eType="#//DataSet" resolveProxies="false"
> eOpposite="#//DataSet/parent"/>
>
>
> The features are both unique to avoid duplications whithin my
> collections.
> When i save my model the first everything works fine, but when i load
> it, i when the XMLLoader add an object in the feature parent, it also
> add the object in the child feature but it does not check the content,
> so after the model is loaded i have multiple times the same objects in
> both the list.
>
> The only way to avoid this behavior was for me to make my parent
> feature transcient.
>
> Is this behavior(having multiple time the same objects in the features
> collections) expected ? And is there another way to prevent this to
> happen?
The scenario you describe should be handled okay as is. You might try
using OPTION_DEFER_IDREF_RESOLUTION to see if that eliminates the problem.
>
> Thanx.
> Ludovic
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02414 seconds