vestabu / odata4j

Automatically exported from code.google.com/p/odata4j
0 stars 0 forks source link

Querying complex paths #233

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Perform a query similar to the following:

consumer.getEntities(Device.class, 
"Sites(123456789L)/Devices").execute().toList();

What is the expected output? What do you see instead?

I'm getting a NullPointerException that can be traced to the findEdmEntitySet 
method in EdmDataServices. When iterating through the EdmEntitySet list, the 
value being compared is expected to be something like "Devices", while the 
entitySetname is "Sites(123456789L)/Devices". A quick workaround is to change 
line 79 to the following:

if (ees.getName().equals(entitySetName) || entitySetName.endsWith("/" + 
ees.getName()))

What version of the product are you using? On what operating system?
0.8.0-SNAPSHOT, Ubuntu 12.04

Please provide any additional information below.

Suggestion from John: In this case, we should probably parse that string into a 
path for resolution purposes instead of relying on the navigation property name 
(part after the slash), which may or may not equal the entity set name.

Original issue reported on code.google.com by wals...@gmail.com on 26 Nov 2012 at 3:19

GoogleCodeExporter commented 8 years ago
I made some changes to "EdmDataServices.java" file if anyone's interested.

Original comment by wals...@gmail.com on 17 Jul 2013 at 3:29

Attachments: