You are here: Re: sql code for UML composition relation - anyone? « MsSQL Server « IT news, forums, messages
Re: sql code for UML composition relation - anyone?

Posted by AlterEgo on 01/19/07 19:11

fireball,

It looks to me like your model is defining a 1:n structure, not 1:1.

ParentTable
------------
ParentID (PK)

ChildTable
------------
ChildID (PK)
ParentID (FK)

ChildTable data example
--------------
ChildID, ParentID
1, 100
2, 100
3, 100

In this scenario, you can have one Parent (100) for many Children (1,2,3).
To implement this physically, just make sure you have a ParentID column in
the ChildTable that references the ParentTable.

Is that the question you were asking?

-- Bill

"fireball" <fireball@onet.kropka.eu> wrote in message
news:eoqnag$3ka$1@nemesis.news.tpi.pl...
> hi, I got confused for a moment about creating data structure for UML
> composition (strong aggregation) relation one-to-many.
>
> I used Rose/DataModeler to do so.
> [Parent] <filled_diamond>-------- [Child]
>
> I got P/FK (primary key of my component is foreign key of it's container)
> in my child table:
>
> Parent: PK Parent_ID
> Child: P/FK Parent_ID
>
> that way I found out I got relation 1:1, I'm still not sure how to create
> data structure realizing compositiona one-to-many.
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация