@Override public IDataProviderResponse readExpandedEntity(GetEntityUriInfo uriInfo, ODataContext context) throws ODataException { logger.debug("Entering CXSDataProvider >> {readExpandedEntity}"); if (uriInfo.getExpand() != null) { expanding = true; } BaseDataProviderResponse response = (BaseDataProviderResponse) super.readExpandedEntity(uriInfo, context); logger.debug("Exiting CXSDataProvider >> {readExpandedEntitySet}"); return response; }
@Override public IDataProviderResponse readExpandedEntity(GetEntityUriInfo uriInfo, ODataContext context) throws ODataException { GWUriInfo gwUriInfo = new GWUriInfo((UriInfo) uriInfo, uriInfo.getStartEntitySet(), uriInfo.getKeyPredicates(), uriInfo.getNavigationSegments(), uriInfo.getFilter()); gwUriInfo.setExpand(new ArrayList<ArrayList<NavigationPropertySegment>>()); gwUriInfo.setSelect(new ArrayList<SelectItem>()); IDataProviderResponse response = readEntity(gwUriInfo, context); HashMap<String, Object> resultMap = new HashMap<String, Object>(); resultMap.putAll(response.getResultEntity()); ExpandSelectTreeNode expandSelectTreeNode = UriParser.createExpandSelectTree(uriInfo.getSelect(), uriInfo.getExpand()); Map<String, ExpandSelectTreeNode> links = expandSelectTreeNode.getLinks(); EdmEntitySet entitySet = uriInfo.getTargetEntitySet(); for (Entry<String, ExpandSelectTreeNode> expandNodeEntry : links.entrySet()) { Object singleResult = getSingleNavigationPathResult(expandNodeEntry, entitySet, resultMap, (UriInfo) uriInfo, context); resultMap.put(expandNodeEntry.getKey(), singleResult); } BaseDataProviderResponse baseResponse = new BaseDataProviderResponse(); baseResponse.setResultEntity(resultMap); return baseResponse; }
private static EntityProviderWriteProperties getEntityProviderProperties(final ODataJPAContext odataJPAContext, final GetEntityUriInfo resultsView) throws ODataJPARuntimeException { ODataEntityProviderPropertiesBuilder entityFeedPropertiesBuilder = null; ExpandSelectTreeNode expandSelectTree = null; try { entityFeedPropertiesBuilder = EntityProviderWriteProperties.serviceRoot(odataJPAContext.getODataContext().getPathInfo().getServiceRoot()); expandSelectTree = UriParser.createExpandSelectTree(resultsView.getSelect(), resultsView.getExpand()); entityFeedPropertiesBuilder.expandSelectTree(expandSelectTree); entityFeedPropertiesBuilder.callbacks(JPAExpandCallBack.getCallbacks(odataJPAContext.getODataContext() .getPathInfo().getServiceRoot(), expandSelectTree, resultsView.getExpand())); } catch (ODataException e) { throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e); } return entityFeedPropertiesBuilder.build(); }
private static EntityProviderWriteProperties getEntityProviderProperties(final ODataJPAContext odataJPAContext, final GetEntityUriInfo resultsView) throws ODataJPARuntimeException { ODataEntityProviderPropertiesBuilder entityFeedPropertiesBuilder = null; ExpandSelectTreeNode expandSelectTree = null; try { entityFeedPropertiesBuilder = EntityProviderWriteProperties.serviceRoot(odataJPAContext.getODataContext().getPathInfo().getServiceRoot()); expandSelectTree = UriParser.createExpandSelectTree(resultsView.getSelect(), resultsView.getExpand()); entityFeedPropertiesBuilder.expandSelectTree(expandSelectTree); entityFeedPropertiesBuilder.clientCallbacks(resultsView.getClientCallbacks()); entityFeedPropertiesBuilder.callback(resultsView.getCallback()); entityFeedPropertiesBuilder.callbacks(JPAExpandCallBack.getCallbacks(odataJPAContext, odataJPAContext.getODataContext() .getPathInfo().getServiceRoot(), expandSelectTree, resultsView.getExpand())); } catch (ODataException e) { throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e); } return entityFeedPropertiesBuilder.build(); }
expandList = resultsView.getExpand(); if (expandList != null && !expandList.isEmpty()) { HashMap<String, Object> navigationMap =
expandList = resultsView.getExpand(); if (expandList != null && !expandList.isEmpty()) { HashMap<String, Object> navigationMap =
@Override public ODataResponse readEntity(final GetEntityUriInfo uriInfo, final String contentType) throws ODataException { final Object data = retrieveData( uriInfo.getStartEntitySet(), uriInfo.getKeyPredicates(), uriInfo.getFunctionImport(), mapFunctionParameters(uriInfo.getFunctionImportParameters()), uriInfo.getNavigationSegments()); if (!appliesFilter(data, uriInfo.getFilter())) { throw new ODataNotFoundException(ODataNotFoundException.ENTITY); } final ExpandSelectTreeNode expandSelectTreeNode = UriParser.createExpandSelectTree(uriInfo.getSelect(), uriInfo.getExpand()); ODataResponse odr = ODataResponse.fromResponse(writeEntry(uriInfo.getTargetEntitySet(), expandSelectTreeNode, data, contentType)) .build(); return odr; }
@Override public ODataResponse readEntity(final GetEntityUriInfo uriInfo, final String contentType) throws ODataException { final Object data = retrieveData( uriInfo.getStartEntitySet(), uriInfo.getKeyPredicates(), uriInfo.getFunctionImport(), mapFunctionParameters(uriInfo.getFunctionImportParameters()), uriInfo.getNavigationSegments()); if (!appliesFilter(data, uriInfo.getFilter())) { throw new ODataNotFoundException(ODataNotFoundException.ENTITY); } final ExpandSelectTreeNode expandSelectTreeNode = UriParser.createExpandSelectTree(uriInfo.getSelect(), uriInfo.getExpand()); ODataResponse odr = ODataResponse.fromResponse(writeEntry(uriInfo.getTargetEntitySet(), expandSelectTreeNode, data, contentType)) .build(); return odr; }
@Override public ODataResponse readEntity(final GetEntityUriInfo uriInfo, final String contentType) throws ODataException { final Object data = retrieveData( uriInfo.getStartEntitySet(), uriInfo.getKeyPredicates(), uriInfo.getFunctionImport(), mapFunctionParameters(uriInfo.getFunctionImportParameters()), uriInfo.getNavigationSegments()); if (!appliesFilter(data, uriInfo.getFilter())) { throw new ODataNotFoundException(ODataNotFoundException.ENTITY); } final ExpandSelectTreeNode expandSelectTreeNode = UriParser.createExpandSelectTree(uriInfo.getSelect(), uriInfo.getExpand()); ODataResponse odr = ODataResponse.fromResponse(writeEntry(uriInfo.getTargetEntitySet(), expandSelectTreeNode, data, contentType)) .build(); return odr; }
IDataProviderResponse dataProviderResponse; if (uriInfo.getFunctionImport() == null) { if (uriInfo.getExpand().isEmpty()) { if (getContext().isInBatchMode()) { IReadEntityParameter parameter = new ReadEntityParameter(