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); } }