Hi Hanif, On 12 Feb 2014, at 22:18, Rajabali, Hanif <[email protected]> wrote:
> I'm having trouble defining the navigation property elements for the > InsurancePolicy to InsuranceContract relationship and then mapping the whole > InsurancePolicy object including the InsuranceContracts to a > List<Map<String, Object>> for consumption by EntityProvider.writeFeed(). > Everything resolves fine for the InsurancePolicy except for the display of > the InsuranceContract. Do I have to use the $expand system option in > order to display the navigational elements or can it just be done by some > default switch? What do I need to add in readEntitySet() in order to > resolve my navigation properties and have them included as part of the > Odataresponse? For your use case of serializing the InsurancePolicy with its expanded InsuranceContracts you have to use the EntityProvider.write*(…) methods in combination with the OnWriteEntryContent and OnWriteFeedContent Callbacks as described here: http://olingo.staging.apache.org/doc/tutorials/read_expand.html As short summary according to the mentioned documentation. If the callbacks are correct registered they will be called when InsurancePolicy is serialized and an expanded navigation property is found. In the callback itself you then have to provide the data for the InsuranceContract which then should be serialized and displayed at the response. If you need additional help, just write. Kind regards, Michael
smime.p7s
Description: S/MIME cryptographic signature
