Mapping Example For Complex Repository Structure
A complex repository structure where one of the child repositories is related to the parent repository by multiple relationships. Consider the following scenario where four repositories are related to each other:
Customer > Account > Address and Customer > Status > Address
The relationship among these four repositories is as follows:
CustomerAccount, CustomerStatus, AccountAddress, and StatusAddress
In this scenario, the Address repository is related to the Customer repository by AccountAddress and StatusAddress relationships.
- Forward Relationship Mapping
While creating an output map for a parent repository, you can select all forward cross-repository relationships with a common synchronization format or different synchronization formats for different relationships. You can use the same output map from the related repository to be related to the parent repository by two different relationships. In the following scenario, you can use the Address repository to be related with the parent output map in the Customer repository by AccountAddress and StatusAddress relationships.
- Reverse Relationship Mapping
You can add a related output map in the reverse relationship. Consider the following scenario: Customer > Address and Account > Address
For the Customer repository and the CustomerAddress forward relationship, if you create an output map as CustomerOutputMap and the related output map as AddressOutputMap, then for the Address repository, when you select the AccountAddress reverse relationship, you can create the related output map as AccountOutputMap for the AddressOutputMap.