Create a Business Object Relationship

You can create a business object relationship from the Relationships area of an object's Overview tab.

You can also define a relationship using the Diagrammer. See Create Relationships with the Diagrammer.

To create a new relationship:

  1. In the Business Objects tab, select the business object that you want to view.
    The contents of the Overview tab are displayed.
  2. Click + Relationship next to Relationships.
  3. In the dialog box, select the business object you want to create a relationship with.
  4. Select the cardinality for each object (Many or One). The default is many-to-one.
    You can click the Reverse Relationship button to switch between one-to-many and many-to-one. You can specify cardinalities of one-to-one and many-to-many between business objects, in addition to many-to-one and one-to-many.

    If you specify many-to-many, an intersection business object with two reference fields (in our example, EmployeeProject with the project and employee fields) is automatically created. Its default name is a concatenation of the two business objects (which can be changed if you want). For an intersection business object, you can't deselect the Required check box in either of the reference fields, and the default delete rule is Cascade.
    Description of bo-relships-mtom.png follows
    Description of the illustration bo-relships-mtom.png

    Tip:

    If an existing business object has many-to-one relationships with both source and target of the many-to-many relationship, the business object will appear in the Select a business object drop-down list. You can use this object instead of creating a new intersection business object.
    The Enable Accessor check box is selected by default for the Many side of the relationship. Keep the check box selected unless you want to disable access to the other business object.
  5. Edit the properties of the relationship field (Field Name, Display Label, Required check box, Delete Rule, and Display Field). Whether you can edit a property and what values are available depends on the nature of the relationship and the objects.

    The Delete Rule determines what happens when a record that has a relationship to another record is deleted. The available choices are:

    • Restrict: you aren't allowed to delete a parent that has children (the default rule for a one-to-many relationship)
    • Cascade: when you delete a parent, the children of that parent are automatically deleted (the default rule for an intersection object)
    • Set To Null: when you delete a parent, the parent relationship field in the children is set to null
  6. Click Create Relationship.
The new relationship is displayed in the Relationships list on the Overview page, along with the accessor that lets you access the business object at the other end of the relationship. Clicking the accessor name will take you to the Fields tab, where you'll see the accessor listed along with standard fields.

For referenced business objects, the relationship between the current business object and the one being referenced is, by default, many-to-one. When you create a reference from, say, an Employee business object to a Department business object, an Employee can belong to only one Department, but a Department normally has many employees. Such a relationship is first shown as a dotted line for the object that represents the one side. When you click the line, the details from the many business object are loaded and the relationship is shown:
Description of bo-relships.png follows
Description of the illustration bo-relships.png

The referenced business object, Department, also appears in the Endpoints tab for the Employee business object.