WriteFeedCallbackResult result = new WriteFeedCallbackResult();
HashMap<String, Object> inlinedEntry = (HashMap<String, Object>) context.getEntryData();
List<Map<String, Object>> edmEntityList = new ArrayList<Map<String, Object>>();
JPAEntityParser jpaResultParser = new JPAEntityParser();
List<EdmNavigationProperty> currentNavPropertyList = null;
EdmNavigationProperty currentNavigationProperty = context.getNavigationProperty();
ExpandSelectTreeNode currentExpandTreeNode = context.getCurrentExpandSelectTreeNode();
try {
@SuppressWarnings({ "unchecked" })
Collection<Object> listOfItems = (Collection<Object>) inlinedEntry.get(context.getNavigationProperty().getName());
if (nextEntitySet == null) {
nextEntitySet = context.getSourceEntitySet().getRelatedEntitySet(currentNavigationProperty);
}
if (currentExpandTreeNode.getProperties().size() > 0) {
edmEntityList =
jpaResultParser.parse2EdmEntityList(listOfItems, getEdmProperties(nextEntitySet,
currentExpandTreeNode));
} else {
edmEntityList = jpaResultParser.parse2EdmEntityList(listOfItems, nextEntitySet.getEntityType());
}
result.setFeedData(edmEntityList);
if (currentExpandTreeNode.getLinks().size() > 0) {
currentNavPropertyList = new ArrayList<EdmNavigationProperty>();
EdmNavigationProperty nextNavProperty =
getNextNavigationProperty(context.getSourceEntitySet().getEntityType(), context.getNavigationProperty());
if (nextNavProperty != null) {
currentNavPropertyList.add(nextNavProperty);
}
int count = 0;