try {
Entity relatedEntity = datastore.get((Key) navPropValue);
return Responses.entity(toOEntity(eesNavProp, relatedEntity, queryInfo, null));
} catch (EntityNotFoundException exception) {
exception.printStackTrace();
throw new NotImplementedException();
}
} else if (relMultiplicity == EdmMultiplicity.MANY) {
try {
@SuppressWarnings("unchecked")
Collection<Key> relatedKeys = (Collection<Key>) navPropValue;
Map<Key, Entity> relatedEntities = datastore.get(relatedKeys);
final QueryInfo qi = queryInfo;
Iterable<Entity> iter = relatedEntities.values();
List<OEntity> entities = Enumerable.create(iter).select(new Func1<Entity, OEntity>() {
public OEntity apply(Entity input) {
return toOEntity(eesNavProp, input, qi, null);
}
}).toList();
Integer inlineCount = queryInfo.inlineCount == InlineCount.ALLPAGES ? entities.size() : null;
return Responses.entities(entities, eesNavProp, inlineCount, null);
} catch (Exception exception) {
exception.printStackTrace();
throw new NotImplementedException();
}
} else {
throw new NotImplementedException();
}
}