@Override
public EntityIdResponse getLinks(OEntityId sourceEntity, String targetNavProp) {
BaseResponse r = getNavProperty(sourceEntity.getEntitySetName(), sourceEntity.getEntityKey(), targetNavProp, null);
if (r instanceof EntitiesResponse) {
EntitiesResponse er = (EntitiesResponse) r;
return Responses.multipleIds(er.getEntities());
}
if (r instanceof EntityResponse) {
EntityResponse er = (EntityResponse) r;
return Responses.singleId(er.getEntity());
}
throw new NotFoundException("EdmNavigationProperty " + targetNavProp + " of entity " + sourceEntity + " not found.");
}