} else if (ENTITY_SET_NAME_MANUFACTURERS.equals(entitySet.getName())) {
return EntityProvider.writeFeed(contentType, entitySet, dataStore.getManufacturers(),
EntityProviderWriteProperties.serviceRoot(getContext().getPathInfo().getServiceRoot()).build());
}
throw new ODataNotFoundException(ODataNotFoundException.ENTITY);
} else if (uriInfo.getNavigationSegments().size() == 1) {
// navigation first level, simplified example for illustration purposes only
entitySet = uriInfo.getTargetEntitySet();
if (ENTITY_SET_NAME_CARS.equals(entitySet.getName())) {
int manufacturerKey = getKeyValue(uriInfo.getKeyPredicates().get(0));
List<Map<String, Object>> cars = new ArrayList<Map<String, Object>>();
cars.addAll(dataStore.getCarsFor(manufacturerKey));
return EntityProvider.writeFeed(contentType, entitySet, cars, EntityProviderWriteProperties.serviceRoot(
getContext().getPathInfo().getServiceRoot()).build());
}
throw new ODataNotFoundException(ODataNotFoundException.ENTITY);
}
throw new ODataNotImplementedException();
}