In the Data Designer, the Relationships area of the Overview tab for a business object displays the relationships between that business object and other business objects in your application.
When you create a reference to another business object or when you create a lookup data object, the relationship between the current business object and the one being referenced or looked up is, by default, many-to-one. For example, when you create a reference from an Employee business object to a Department business object, an Employee can belong to only one Department, but a Department normally has many employees. Similarly, when you create a Locations business object as a lookup value for a Department, a Department can have only one Location, but a Location can have multiple departments.
Description of the illustration data-designer-objects-relships.png
You can delete a relationship, but only if it is not used anywhere in your application.
To create a new relationship:
- Click Data Designer in the main menu and open Business Objects.
- Select the database you want to view in the dropdown list.
- Select the business object that you want to view.The contents of the Overview tab are displayed.
- Click the Add icon next to Relationships.
- In the dialog box, select the business object you want to create a relationship with.
- Select the cardinality for each object (Many or 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 is automatically created. Its name is a concatenation of the two business objects. 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.
- Edit the properties of the relationship field (the Label, the Default Display Field, the Required check box, the Delete Rule). For the Delete Rule, the available choices are Cascade, Restrict, and Set To Null. Whether you can edit a property and what values are available depends on the nature of the relationship and the objects.
Description of the illustration data-designer-objects-relships-mtom.png
- Click Create.
- Click Save to save the new relationship.
To edit a relationship, click the Edit icon next to the relationship name and make the changes you want to. Some fields cannot be edited and are disabled. You can specify the Label and select the Default Display Field. You may be able to select the Required check box for the field, and you can specify a Delete Rule. The default Delete Rule is Restrict, but you may be able to select Cascade or Set To Null.