@Override public boolean isBound() { return this.uriResourceFunction.getFunctionImport() != null; }
@Override public boolean isBound() { return this.uriResourceFunction.getFunctionImport() != null; }
private EdmBindingTarget getEntitySetFromFunctionImport(final UriResourceFunction uriResourceFunction) { EdmFunctionImport functionImport = uriResourceFunction.getFunctionImport(); if (functionImport != null && functionImport.getReturnedEntitySet() != null && !uriResourceFunction.isCollection()) { return functionImport.getReturnedEntitySet(); } return null; }
private EdmBindingTarget getEntitySetFromFunctionImport(final UriResourceFunction uriResourceFunction) { EdmFunctionImport functionImport = uriResourceFunction.getFunctionImport(); if (functionImport != null && functionImport.getReturnedEntitySet() != null && !uriResourceFunction.isCollection()) { return functionImport.getReturnedEntitySet(); } return null; }
public static EdmEntitySet getStartingEdmEntitySet(final UriInfoResource uriInfo,Locale locale) throws ODataApplicationException { EdmEntitySet entitySet = null; final List<UriResource> resourcePaths = uriInfo.getUriResourceParts(); // First must be an entity, an entity collection, a function import, or an action import. blockTypeFilters(resourcePaths.get(0),locale); if (resourcePaths.get(0) instanceof UriResourceEntitySet) { entitySet = ((UriResourceEntitySet) resourcePaths.get(0)).getEntitySet(); }else if (resourcePaths.get(0) instanceof UriResourceFunction) { entitySet = ((UriResourceFunction) resourcePaths.get(0)).getFunctionImport().getReturnedEntitySet(); } else if (resourcePaths.get(0) instanceof UriResourceAction) { entitySet = ((UriResourceAction) resourcePaths.get(0)).getActionImport().getReturnedEntitySet(); } else { getResourceLable(locale); throw new ODataApplicationException(labels.getString("INVALID_RESOURCE_TYPE"), HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), locale,labels.getString("INVALID_RESOURCE_TYPE_CODE")); } return entitySet; }
entitySet = ((UriResourceEntitySet) resourcePaths.get(0)).getEntitySet(); } else if (resourcePaths.get(0) instanceof UriResourceFunction) { entitySet = ((UriResourceFunction) resourcePaths.get(0)).getFunctionImport().getReturnedEntitySet(); } else if (resourcePaths.get(0) instanceof UriResourceAction) { entitySet = ((UriResourceAction) resourcePaths.get(0)).getActionImport().getReturnedEntitySet();
entitySet = ((UriResourceEntitySet) resourcePaths.get(0)).getEntitySet(); } else if (resourcePaths.get(0) instanceof UriResourceFunction) { entitySet = ((UriResourceFunction) resourcePaths.get(0)).getFunctionImport().getReturnedEntitySet(); } else if (resourcePaths.get(0) instanceof UriResourceAction) { entitySet = ((UriResourceAction) resourcePaths.get(0)).getActionImport().getReturnedEntitySet();
private void handleFunctionDispatching(final ODataRequest request, final ODataResponse response, final UriResourceFunction uriResourceFunction) throws ODataApplicationException, ODataLibraryException { EdmFunction function = uriResourceFunction.getFunction(); if (function == null) { function = uriResourceFunction.getFunctionImport().getUnboundFunctions().get(0); } final EdmReturnType returnType = function.getReturnType(); switch (returnType.getType().getKind()) { case ENTITY: handleEntityDispatching(request, response, returnType.isCollection() && uriResourceFunction.getKeyPredicates().isEmpty(), false); break; case PRIMITIVE: handlePrimitiveDispatching(request, response, returnType.isCollection()); break; case COMPLEX: handleComplexDispatching(request, response, returnType.isCollection()); break; default: throw new ODataHandlerException(NOT_IMPLEMENTED_MESSAGE, ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED); } }
private void handleFunctionDispatching(final ODataRequest request, final ODataResponse response, final UriResourceFunction uriResourceFunction) throws ODataApplicationException, ODataLibraryException { EdmFunction function = uriResourceFunction.getFunction(); if (function == null) { function = uriResourceFunction.getFunctionImport().getUnboundFunctions().get(0); } final EdmReturnType returnType = function.getReturnType(); switch (returnType.getType().getKind()) { case ENTITY: handleEntityDispatching(request, response, returnType.isCollection() && uriResourceFunction.getKeyPredicates().isEmpty(), false); break; case PRIMITIVE: handlePrimitiveDispatching(request, response, returnType.isCollection()); break; case COMPLEX: handleComplexDispatching(request, response, returnType.isCollection()); break; default: throw new ODataHandlerException(NOT_IMPLEMENTED_MESSAGE, ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED); } }