WebSphere Adapter for JDBC

Multiple-cardinality relationships in business objects

In a multiple-cardinality relationship, an attribute in the parent business object represents an array of child business objects. The attribute is of the same type as the child business object. The foreign key that describes the relationship is stored in the child, except when an application stores a single-child entity. Then the parent-child relationship is stored in the parent.

Typically, a business object that contains an array of child business objects has only one attribute that represents the relationship, and this attribute is normally the primary key. The type of the attribute is an array of the same type as the child business objects. For a parent to contain more than one child, the foreign keys that establish the relationship are stored in the child.

Therefore, each child has at least one simple attribute that contains the parent’s primary key as a foreign key. The child has as many foreign key attributes as the parent has primary key attributes.

Because the foreign keys that establish the relationship are stored in the child, each parent can have zero or more children.

The figure titled "Multiple-cardinality business object relationship" illustrates a multiple-cardinality relationship. In the example, ParentId in the three ChildBOName boxes is the simple attribute that contains the parent’s primary key, and Child1 in the ParentBOName box is that attribute that represents the array of child business objects.

Figure 1. Multiple cardinality business object relationship
This figure shows one box on the left with one column. The column heading is ParentBOName. Under the heading are two rows. The first row is called ID and the second is Child(1). On the right are three one-column boxes that each have a heading of ChildBOName and a row called ParentID. The three boxes are connected by horizontal lines to a vertical line. An arrow from the vertical line points to the box on the left at the ID row.

A multiple cardinality relationship could be an N=1 relationship. Some applications store one child entity so that the parent-child relationship is stored in the child rather than in the parent. In other words, the child contains a foreign key whose value is identical to the value stored in the parent’s primary key.

Applications use this type of relationship when child data does not exist independently of its parent and can be accessed only through its parent. Such child data requires that the parent and its primary key value exist before the child and its foreign key value can be created. The figure titled "Multiple cardinality relationship with N=1" shows this type of relationship.

Figure 2. Multiple cardinality relationship with N=1
This figure has a box on the left with one column. The column heading is ParentBOName. There are two rows below the heading. The first row says ID and the second row says Child(1). On the right is a one-column box with the heading ChildBOName. One row under the heading says ParentID. An arrow from the ParentID row points to the ID row in the box on the left.

Terms of use |

Last updated: Tue 12 Dec 2006 03:32:39

(c) Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)