[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: EMF newbie question

Mauro,

Comments below.

Mauro Condarelli wrote:
Hi Everybody,
I am a complete newbie to EMF and thus, please, bear with me :)

I am trying to setup my first (after tutorials) real EMF project.

I am using annotated java to define my model (as per tutorials, again).

My current problem is: how to fill-up references (contained="false") as references to a "real" container (something similar to enums, but with a List of real classes).

I have a series of Interfaces:
IProduct: name, description, price, ...
IOrder: reference to IProduct, quantity, deliveryDate, ...
ICustomer: name, address, ..., List<IOrder>
IFirm: name, address, ..., List<IProduct>, List<ICustomer>

I am simplifying, of course.
My problem is the "reference to IProduct" should not be owned by IOrder, but a reference to some IProduct already defined and owned by IFirm.
This would be a FOREIGN KEY in SQL.
I would expect an editor showing a (dynamically filled) list (or combo) but I have been unable to achieve this.
Unless you add containment="true" you should end up with a non-containment reference. Note that you can always create an Ecore model and generate the code to see what @model annotations come out for that. I'd also suggest you look at the nice EMF refcard. http://refcardz.dzone.com/refcardz/essential-emf

Can someone point me in the right direction? Thanks in advance.