Hi Tony!

Thanks for your quick answer. But I'm still not convinced. Besides many to
many relation there is, as I see it, no need for a third table (with this
principle, a many-to-many relation would result in five tables as you
translate it to two many-to-one, or?). Let me exemplify my conception with
order and orderlines (one to many):

OO-model

Order:
     public abstract void setOrderId(String orderId);
     public abstract String getOrderId();
     public abstract Collection getOrderLines(); // A collection with references to 
orderlines

OrderLines:
     public abstract void setOrderLineId(String orderLineId);
     public abstract String getOrderLineId();

An ER-model of the same relation would according to my conception be as follows (if 
you disregard the mapping):

Order:
     OrderId (PK)

OrderLines
     OrderLineId (PK)
     OrderId (FK) // Foreign key to order.

In this case there is no redundancy. Or am I totally lost?

Regards, Theis.





Reply via email to