DataModel1.gif (5854 bytes) Cardinality with Mandatory Parent

 


This article deals primarily with PowerDesigner

When working with physical data models, and specifically with 0..M and 1..M references one must also consider the mandatory parent attribute. In the reference integrity tab, a minimum cardinality of 1 means that the child is mandatory (one Parent must have a child), which is different from the "Mandatory parent" checkbox, which means that the child must have a parent.

Dialog Box (44KB)

0..*, parent mandatory:

Parent can be a sort of reference table from which values are picked for use in the Children table. Example: Children is an Order Line and Parent is a Product. Just that the Product table is filled first, and that many products can exist which are not referenced by any order line.

1..*, parent mandatory:

The parent has no meaning without children. Example: Parent is an Order, and Children is Order Line, with the business constraint that an order contains at least one line, you just cannot create an empty order. Or Parent is a Customer and Children is an Order. You create customers only when they pass their first order, by copy from a "Prospective Customers" table, for example, in which you store people to whom you have sent advertising.

0..*, parent optional:

Like the first example, except that the foreign key is not always filled in the children table. Example: Children is an Order, and Parent is a list of persons working in the warehouse, and the reference keeps track of who prepared an order for delivery. The order is first created by a salesperson, and then when the goods is available, the order is prepared and at this time only the reference is filled.

1..*, parent optional:

Hum... the parent must have a child as soon as it exists... Parent is a Delivery and Children is an order, and you allow one delivery to bring several orders to your customer, but an order cannot span several deliveries, it must be brought in one shipment. You first create one delivery for one order, and then you can add more orders to this same delivery...


Visitors on this page: [an error occurred while processing this directive]
Last Updated: [an error occurred while processing this directive]