A Relative Entity refers to an entity whose information needs to be processed before processing a child entity. Identifying Relative Entities involves the following steps:
- Examine all attributes in all child entities for foreign key constraints.
- Determine the other entity upon which there is a constraint. This entity is known as the parent entity.
- Determine if the parent entity is a Relative Entity as follows:
- If the parent entity is included in the same Business Object Type as the original entity, then identification of the Relative Entity can be ignored. This is because the parent entity will be processed in any case as part of the Business Object Type.
- If the parent entity is not in the same Business Object Type as the original entity:
- If the parent entity is the Initial Entity of another Business Object Type, then it is not a Relative Entity. Instead, the other Business Object Type has to be made a dependent Business Object Type.
- If the parent entity is a Child Entity or a Relative Entity in another Business Object Type, then it should be considered a Relative Entity.
In the example application, working through the above steps, it is clear that there is only one Relative Entity for the User Business Object Type. This Relative Entity is Category. This is because the attribute ToDo.categoryID has a foreign key relation to the entity Category. However, let's imagine that there is a Category Business Object Type which has Category as the Initial Entity; in this case, instead of Category being a Relative Entity, the User Business Object Type should declare the Category Business Object Type as a dependent Business Object Type.