Hi Pavan,
Can you please explain a bit more about the third point? Also please provide the URL that you are hitting, code of your GET_EXPANDED_ENTITY or GET_EXPANDED_ENTITYSET as a text file attachment. This can help in clarifying the things.
Let me try to explain from my side. Suppose there are 3 entitysets: SOHeaderSet, SOItemSet & SOSchdlineSet and there are two navigation properties defined: SOHeaderToItem, SOItemToSchdline. Now you try to hit these two URLs:
1. /sap/<MyService>/SOHeaderSet?$expand=SOHeaderToItem/SOItemToSchdline
2. /sap/<MyService>/SOHeaderSet?$expand=SOHeaderToItem
The 1st one would give you the complete list containing all 3 sets in response. But 2nd should give only SOHeaderSet and SOItemSet. Here comes the use of
io_expand->compare_to( '<navigationPropertyName>' ). By using this statement you can check which all navigation properties are asked in the request URL and then pass only those properties in the response.
Hope it clarifies the doubt at some extent.
Regards,
Ekansh