Re: Cardinality "highly unusual"
Date: Tue, 15 Feb 2005 16:42:51 +0100
Message-ID: <g65411tb7hlo6eq7iup302vhvt3hav6v59_at_4ax.com>
On Tue, 15 Feb 2005 19:33:36 +0700, Matt M wrote:
>Thanks, you've helped to set my mind at rest!
Hi Matt,
You're welcome! :-)
>Right, you would use a composite entity to resolve a n:m relationship. That
>makes sense if the bookshop sells new books. But my text (actually an MS
>book) deals explicitly with rare and unique books, and uses a composite
>entity to resolve a 1:m relationship between order and book. This strikes me
>as logically and conceptually wrong, but if it is the preferred way of doing
>things then so be it.
I don't think it's the preferred way. I would definitely use 2 tables, with the Books table holding a NULLable column with FOREIGN KEY to the Orders table.
> Try as I might, I simply cannot generate this sort of schema from an ORM
>source model (my preferred modeling method). Instead, I have to do a lot of
>tweaking of the logical diagram mapped from the ORM source model.
I don't have Visio EA, but I did play around a bit with VisioModeler to see what I could find. The "straightforward" approach that I actually prefer (yielding just 2 tables, with the 'Zero-or-One-to-One-or-More' relationship) went just fine; Visiomodeler does not warn about this relationship being unusual but just generates the tables.
I managed to force VisioModeler into using three tables using the following steps:
1. Include "SoldBook" as subtype of "Book"; 2. Change "Order consists of Book" to "Order consists of SoldBook"; 3. Open the properties for "SoldBook" and select "Map to seperate table"in the subtype tab.
After these steps, VisioModeler generated three tables.
>I clicked on the send button too hastily. Please ignore the bit about ORM at
>the bottom.
Oops.
Please don't read my reply to the bit I should have ignored <g>
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)Received on Tue Feb 15 2005 - 16:42:51 CET