I'm having some problems passing from the "teorical" ER model , to design the real model using EOModeller.
Using the Entity-Relationship model I designed the following tables:
MERCEOLOGIA (nome,marca)
PRODOTTO (id,descrizione, referenza, prezzo, foto )
LUOGO (nome)
PRODOTTOESTERNO (PRODOTTO, qtaIniziale, note)
DISPONIBILITA (PRODOTTO,descrizione)
LUOGO-PRODOTTO (luogo, prodotto, quantita)
Where: the uppercase word is the Entity, between the brackets there are the attributes. The underlined words are the Primary Keys.
So..
MERCEOLOGIA has a 1-to-many relation with PRODOTTO, with the PK of PRODOTTO is id and the PK of MERCEOLOGIA
LUOGO and PRODOTTO has many-to-many relation (plus an attribute)
PRODOTTOESTERNO has a one - to-one relation with PRODOTTO. The PK of PRODOTTOESTERNO is the PK of PRODOTTO
DISPONIBILITA has a one-to-many relation with PRODOTTO.
I've no problem if EOM create a "id" PK for every entity.. I add a Unique key on my "teorical" PK and solve this problem...
but...
I don't know how to create one-to-one relations (I can't add them using the button..) and how to model the "foreign" PK..
Can somebody please help me solving this?
Thanks
Francesco