Opposite references not serialized if not in the current resource ? [message #389566] |
Sat, 27 November 2004 14:04  |
Eclipse User |
|
|
|
Hello,
Not sure if it is a bug, or works as documented... somewhere.
I have a class that acts as a container for a set of references with an opposite
relation.
interface Model {
/**
* @model opposite="models" containment="false"
*/
Category getCategory();
}
interface Category {
/**
* @model type="Model" container="false" opposite="category"
*/
List getModels();
}
With this model, i can create some Model and Category and each time a category
is associated with a model, its model list is correctly updated.
If i split my resources so that the allowed categories lies in their own
resource, i can load the resource in a model definition, and associate its category.
But, one the model is saved, this information is stored in the model resource
but the category resource has not been updated.
How to make this work?
(Using Eclipse 3.1, EMF 2.1)
--
Christophe Avare
|
|
|
Re: Opposite references not serialized if not in the current resource ? [message #389579 is a reply to message #389566] |
Mon, 29 November 2004 07:17   |
Eclipse User |
|
|
|
Christophe,
If you look in the doSave of the generated editor, you'll see that it
only saves the first resource in the resource set. You can change this
to save them all. We can also consider generalizing the generated
editor to handle this type of situation better (if you open a bugzilla
feature request).
Christophe Avare wrote:
> Hello,
>
> Not sure if it is a bug, or works as documented... somewhere.
>
> I have a class that acts as a container for a set of references with
> an opposite relation.
>
> interface Model {
> /**
> * @model opposite="models" containment="false"
> */
> Category getCategory();
> }
>
> interface Category {
> /**
> * @model type="Model" container="false" opposite="category"
> */
> List getModels();
> }
>
> With this model, i can create some Model and Category and each time a
> category is associated with a model, its model list is correctly updated.
>
> If i split my resources so that the allowed categories lies in their
> own resource, i can load the resource in a model definition, and
> associate its category.
>
> But, one the model is saved, this information is stored in the model
> resource but the category resource has not been updated.
>
> How to make this work?
> (Using Eclipse 3.1, EMF 2.1)
> --
> Christophe Avare
|
|
|
Re: Opposite references not serialized if not in the current resource ? [message #389596 is a reply to message #389579] |
Mon, 29 November 2004 15:09  |
Eclipse User |
|
|
|
Thanks Ed,
It's a good starting point for me to understand the template system.
Ed Merks a écrit :
> Christophe,
>
> If you look in the doSave of the generated editor, you'll see that it
> only saves the first resource in the resource set. You can change this
> to save them all. We can also consider generalizing the generated
> editor to handle this type of situation better (if you open a bugzilla
> feature request).
>
|
|
|
Powered by
FUDForum. Page generated in 0.02940 seconds