ODataResponse odataResponse = null;
if (resultList != null && !resultList.isEmpty()) {
JPAEntityParser jpaResultParser = new JPAEntityParser();
EdmType edmType = null;
EdmFunctionImport functionImport = null;
Map<String, Object> edmPropertyValueMap = null;
List<Map<String, Object>> edmEntityList = null;
Object result = null;
try {
EntityProviderWriteProperties feedProperties = null;
feedProperties =
EntityProviderWriteProperties.serviceRoot(oDataJPAContext.getODataContext().getPathInfo().getServiceRoot())
.build();
functionImport = resultsView.getFunctionImport();
edmType = functionImport.getReturnType().getType();
if (edmType.getKind().equals(EdmTypeKind.ENTITY) || edmType.getKind().equals(EdmTypeKind.COMPLEX)) {
if (functionImport.getReturnType().getMultiplicity().equals(EdmMultiplicity.MANY)) {
edmEntityList = new ArrayList<Map<String, Object>>();
for (Object jpaEntity : resultList) {
edmPropertyValueMap = jpaResultParser.parse2EdmPropertyValueMap(jpaEntity, (EdmStructuralType) edmType);
edmEntityList.add(edmPropertyValueMap);
}