|
Re: Compartment without containment [message #62572 is a reply to message #62454] |
Sun, 15 October 2006 06:17 |
Eclipse User |
|
|
|
Originally posted by: greenl.mot.com
Jinchao,
For your second question, I think you can create multiple Child References
with each of them has a Node Mapping for different types, and set the
Compartment of all Child Reference to the same compartment mapping.
"Jinchao Huang" <jchuang@ca.ibm.com> wrote in message
news:egqt2n$vre$1@utils.eclipse.org...
> Hello,
>
> The GMF toturial explains the difference between containment and children
> references. As my application needs a compartment holding referenced
> objects, I set the children feature in the gmfmap and leave the
> containment feature blank. However, when creating the generator model a
> GMF message indicates a compartment has to use containmentship. Is there a
> way to go around this restriction?
>
> Also, is it possible to have two different type of referenced objects in
> the same compartment?
>
> Thanks,
> Jinchao
>
>
>
|
|
|
|
|
|
Re: Compartment without containment [message #64240 is a reply to message #63235] |
Tue, 17 October 2006 14:11 |
Jinchao (Joseph) Messages: 12 Registered: July 2009 |
Junior Member |
|
|
Hi Alex,
Thanks for responding to the question. I appreciate it very much.
My problem is that the GMF message is an error message, and the Next button
on the genration wizard is disabled.
In my ecore model the object to be displayed is owned by another model
object (with the containment set to true). To by-pass the error message, I
modified the ecore model so that the object to be displayed is owned by both
that owning object and the object that has the compartment. As a result, all
the objects created inside the compartment are persisted with the object
that has the compartment, not with the original owning object. I don't know
how to modify the generated code to switch the persistence to the original
owning object and create references inside the compartment object.
Thanks,
Jinchao
"Alex Shatalin" <vano@borland.com> wrote in message
news:egvs3s$fst$1@utils.eclipse.org...
> Hello Jinchao,
>
> For your first question: You can simply ignore the validator messages,
> generate code and then modify it by hands. You should only realize that
> you HAVE to put created object somewhere to persist it in the model.
> AFAIK, you can put it into some other object in your model (this is why
> containment references property was invented) or directly into the
> resource. I suggest you to review your model and clarify where
> corresponding objects should be contained. Usually there should be another
> model object keeping all of them.
>
> -----------------
> Alex Shatalin
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03807 seconds