I am having a problem figuring out as to how I can extract the data that I am getting from the uri that I've build from apache olingo. Extracting data from the $expand works with this syntax.
uri: odata/PropertyOrigin?$expand=Property1($select=Field1);$expand=Property2($select=Field1ofProperty2))
/* JSON ->
PropertyOrigin ->
Field1Origin,
Field2Origin,
NavigationProperty1 ->
Field1,
Field2,
Field3,
NavigationProperty2 ->
NavigationField1ofProperty2 <- the one I am trying to extract */
ClientEntity ce = csi.next();
String ExtractData1 = ce.getProperty("Property1").getComplexValue().get("Field1").getValue().toString();
But, when I am trying to get the data from the second $expand, I get a object null reference, because it is not hitting the right property that I am trying to interact with.
ClientEntity ce = csi.next();
String ExtractData2 = ce.getProperty("NavigationProperty1").getComplexValue().get("NavigationProperty2").getComplexValue().get("Field1ofNavigationProperty2").getValue().toString();
Note: NavigationProperty2 is a Collection