RE: Need to publish record from two different table
The idea of using existing entities and merging results is simple.
Imagine that you have a method in the external system which should obtain both customers and vendors and return them as a single data set. Your idea about the implementation is calling a single OData service and returning what you get from it.
Pseudocode:
getCustomersAndVendors(_ID)
combinedData = OData.CustomersAndVendors.Where(...)
result.addRecords(combinedData) // Converting to a format expected by the external system
return result
But you could make one call to get vendors and another to get customers and put both sets of data to an object returned from the method. From caller's point of view, the method behaves exactly as before - we changed mere implementation details, but not the contract.
Pseudocode:
getCustomersAndVendors(_ID)
customers = OData.Customers.Where(...)
result.addRecords(customers)
vendors = OData.Vendors.Where(...)
result.addRecords(vendors)
return result
Fetching vendors in postLoad() of customer entity is impossible for many reasons. The whole purpose of the method is different, it's called at different times than you think (once for every customer meeting the criteria, i.e. maybe never, maybe many times), you can't use it for adding records and even if it all worked, you would get could get result that makes no sense (because it would claim that these vendors are customers).