A Classical Example of Unary relationship in ER Model is available every where. "Manager manages Employee". The ER Diagram goes as -

Unary Relationship Now what if Entity Manager & Employee wants to be associated with some other entities. For Ex- In this classical diagram, how can i add 2 more features:1)Employee operates several Machines 2) Manager attends Meeting. How can i modify this ER Diagram to add these 2 relationships.

I cannot simple relate these two associations with Employee, because a Non-Manager Employee cannot attend meetings.

有帮助吗?

解决方案

Relational structure is not good to represent object oriented relationship. So you can draw your objects relation in class diagram, then convert to relational structure with table-per-hierachy, table-per-class etc. And the restraints between objects will be applied in application level or by ORM framework such as Hibernate.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top